print("attempt {} of {}", format(round, total_attempts)) TypeError: format() argument 2 must be str, not int
Como declaro o argumento 2 em um valor inteiro? tentei alterar a variável, mas dá erro de syntax
print("****************************")
print('Welcome to the guessing game')
print("****************************")
secret_number = 42
total_attempts = 3
round = 1
while (round <= total_attempts):
print("attempt {} of {}", format(round, total_attempts))
guess_str = input("Choose a number: ")
print("You typed: ", guess_str)
guess = int(guess_str)
right = guess == secret_number
higher = guess > secret_number
lower = guess < secret_number
if right:
print("You are right!")
else:
if(higher):
print("You're wrong! your number was higher than the secret number")
elif(lower):
print("You are wrong!your number is lower than the secret number")
round = round + 1
print("Game over")