Answer the question
In order to leave comments, you need to log in
How to fix the algorithm non-execution problem?
I start the program, when a character is selected, the program ends, although it should continue to display text and an input field, how to decide?
import random
import random
class Dog:
def __init__(self, name, age):
self.name = name
self.age = age
#print('Ишак создан')
def sit(self):
print(self.name.title + ' сел ')
def jump(self):
print(self.name.title + ' прыгнул ')
def death(self):
print(self.name.title + ' Ваш помер ')
def fight(self):
print('На' + self.name.title + 'Напали' + random.randint(1, 30) +'живодера')
angryM = Dog('Злой пес Миша' , 18)
chechenM = Dog('Миша Чеченец ' , 31)
kolM = Dog('Сын Колесниковича и Миши' , 7)
print('Cимулятор Миши')
print('1 - Злой пес Миша')
print('2 - Миша Чеченец ')
print('3 - Сын Колесниковича и Миши')
operation=input('Выберите персонажа:')
if operation == 1:
print('Вы выбрали' + angryM.name)
ang=input('продолжайте бегать ...')
if ang == '1':
angryM.fight
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question