samedi 13 février 2021

How to simplify code >? and make him more practical(less strings ets.)

How to make him shorter??? And how to let him work deleting (input) at the last of code?

age = input('Insert youre age:')
age = int(age)
    # varible for counting number of (whiles)
repeate_counts = 0

while repeate_counts <=3:
    repeate_counts +=1
    if  age <= 3:
        print('You have free ticket young mister.')
    elif 3 < age <= 12:
        price = '10$'
        print('Ticket price is' + ' ' + price)
    else:
        price = '15$'
        print('Ticket price is' + ' ' + price )
    age = input('Insert youre age:')
    age = int(age)

Aucun commentaire:

Enregistrer un commentaire