7 kyu

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.

Fundamentals
Object-oriented Programming

Stats:

CreatedAug 26, 2015
PublishedAug 26, 2015
Warriors Trained3406
Total Skips114
Total Code Submissions14452
Total Times Completed1676
Python Completions1676
Total Stars46
% of votes with a positive feedback rating87% of 271
Total "Very Satisfied" Votes214
Total "Somewhat Satisfied" Votes42
Total "Not Satisfied" Votes15
Ad
Contributors
  • adam-tokarski Avatar
  • myjinxin2015 Avatar
  • FArekkusu Avatar
Ad