Python's Dynamic Classes #1
Description:
Timmy's quiet and calm work has been suddenly stopped by his project manager (let's call him boss) yelling:
- Who named these classes?! Class MyClass? It's ridiculous! I want you to change it to UsefulClass!
Tim sighed, he already knew it's gonna be a long day.Few hours later, boss came again:
Much better - he said - but now I want to change that class name to SecondUsefulClass,
and went off. Although Timmy had no idea why changing name is so important for his boss, he realized, that it's not the end, so he turned to you, his guru, to help him and asked you to prepare some function, which could change name of given class.Note: Proposed function should allow only names with alphanumeric chars (upper & lower letters plus ciphers), but starting only with upper case letter. In other case it should raise an exception.
Disclaimer: there are obviously betters way to check class name than in example cases, but let's stick with that, that Timmy yet has to learn them.
To easy? Check Python's Dynamic Classes #2 Kata and Python's Dynamic Classes #3 Kata.
Similar Kata:
Stats:
Created | Aug 26, 2015 |
Published | Aug 26, 2015 |
Warriors Trained | 3406 |
Total Skips | 114 |
Total Code Submissions | 14452 |
Total Times Completed | 1676 |
Python Completions | 1676 |
Total Stars | 46 |
% of votes with a positive feedback rating | 87% of 271 |
Total "Very Satisfied" Votes | 214 |
Total "Somewhat Satisfied" Votes | 42 |
Total "Not Satisfied" Votes | 15 |