Группа Python Python vitaliy 9 месяцев назад

Игра Мега Танки python (дз)

153 просмотра

import random

print("Hello, welcome to Mega Tanks!")

killed_tanks = random.randint(1, 70)

points_per_tank = 100

score_for_killed_tanks = killed_tanks * points_per_tank

broken_buildings = random.randint(1, 100)

points_per_buildings = 120

score_for_broken_buildings = broken_buildings * points_per_buildings

score_for_broken_buildings_and_killed_tanks = score_for_broken_buildings + score_for_killed_tanks

shot_counter = random.randint(20, 100)

print("Spent!")

print(f"done shot {shot_counter}")

if shot_counter < killed_tanks:

print("You are MASTER")

else:

print("You are NOOB")

print(f"score for killed tanks {score_for_killed_tanks} points")

print(f"score for broken buildings {score_for_broken_buildings} points")

print(f"You have {score_for_broken_buildings_and_killed_tanks} points")

Файл:
hello.py 1 Кбскачан 15 раз
Нет комментариев. Ваш будет первым!