+ 2
Python stressed me out
So, somebody explain to me why this code is wrong? wins = 10 ties = 3 score = wins * 3 + ties * 1 message = "Score: " + str(score) print(message) These huge chess challenges just won’t let me move on to the next level.
10 Antwoorden
0
You must learn programming
+ 4
Your code is actually correct, nothing wrong there. If you want it cleaner just use an f-string
wins = 10
ties = 3
score = wins * 3 + ties * 1
print(f"Score: {score}")
+ 4
#Hi! Please, try to run this code:
wins = int(input())
ties = int(input())
score = wins * 3 + ties * 1
message = "Score: " + str(score)
print(message)
+ 3
DO NOT HARDCODE THE VALUES. Get user input(). Work with user input. Pay attention to input().
input()
+ 2
Guys, thanks! I’m getting it and I passed to the next level.
0
wins = 10 The first variable to save a number
tie=3 Second variable
You can summarize it this way:
print(wins*3+ties*1) The equation works within the print.
Or
wins=10
ties=3
score=wins*3+ties*1
print(f"Voici votre résultat {score}") Voici comment combiner texte et valeur.
0
Or just convert those wins and ties to str first
0
So I'm bigger what should I do
0
What do you mean bro
0
Who