RUVIDEO
Поделитесь видео 🙏

Python Challenges (Class & Inheritance)

#python #pythonclasses #Inheritance
In this video we will cover a python challenge, and how to solve it. However these challenges are made to test you, and help build your skills so please try to solve them before watching this video!

Hope this helps solidifies your knowledge on classes, and Inheritance with classes, and hope you enjoy the video!

Twitter: https://twitter.com/BitWizard8
Discord: https://discord.gg/yKQjT8r

Player
Your Player class will need to consist of the following:
Attributes
• name
• health (HP)
• damage
• defense
Functions/Constructors
• _init_
• characterCreate( ) – prompts the user to input values for each of your attributes and displays
chosen values back to user

Enemy
Enemy will inherit from your Player class. You will need to add/modify the following:
Attribute (new)
• type
Functions/Constructor (Override)
• _init_
• characterCreate( ) – prompts the user to input values for each of your attributes
The Enemy class should add an extra field called type and will be required to override
the characterCreate( ) method from Player to allow a user to select between three (3) enemy types of
our choosing. Based upon the user's choice the other attributes should be automatically set according to
the type of enemy chosen.


Possible enemy types are Minion, Brawler, and Elite.
When selected:
• Minion stats are automatically set to Health 10, Damage 2, and Defense 1.
• Brawler stats are automatically set to Health 30, Damage 10, and Defense 5.
• Elite stats are automatically set to Health 100, Damage 20, and Defense 20.

Upon runtime, our program should perform the following:
1. Create an instance of the Player class
2. Use the Player object to call its characterCreate() function
3. User will be prompted to enter all appropriate values for the Player’s character creation
4. Create an instance of the Enemy class
5. Use the Enemy object to call its characterCreate() function
6. User will be prompted to enter Enemy name and type. Remaining values will be pre-determined
based on user’s input

Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Python Challenges (Class & Inheritance)», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.

Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.

Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!

Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.