+ 2

Solved Chess tournament you’re creating code for a chess tournament

# Convert the values into numbers wins = input() ties = input() # 1 win = 3 points # 1 tie = 1 point # Calculate the score score = int(3*wins+ int ties) # Concatenate the 2 strings to produce a message message = "Score: "+ str(score) # Display the message print(message)

18th Feb 2025, 1:37 PM
Christian Francis
Christian Francis - avatar
17 Answers
+ 4
Christian Francis did you use int(wins) and int(ties) In the above code example you didn't this converts a string to an integer score = int(wins)*3 + int(ties)*1
18th Feb 2025, 3:15 PM
BroFar
BroFar - avatar
+ 4
I did it
18th Feb 2025, 4:57 PM
Christian Francis
Christian Francis - avatar
+ 4
# Convert the values into numbers wins = input() ties = input() # 1 win = 3 points # 1 tie = 1 point # Calculate the scor score = int(wins)*3 + int(ties)*1 # Concatenate the 2 strings to produce a message message = "Score: " +str(score) # Display the message print (message)
18th Feb 2025, 4:58 PM
Christian Francis
Christian Francis - avatar
+ 3
Line 1: "Convert the values into numbers". State clearly what issue you encounter.
18th Feb 2025, 2:25 PM
Lisa
Lisa - avatar
+ 3
Im not guessing
18th Feb 2025, 4:53 PM
Christian Francis
Christian Francis - avatar
+ 2
Suppose the team has 4 wins and 1 draw. What score should the program output? What score do you observe it to output? Stating what issues you encounter means describing what happens when you run the program: What is the desired output? What is the actual output? What is the error message that the program displays?
18th Feb 2025, 3:11 PM
Lisa
Lisa - avatar
+ 2
Convert the values that are stored in the variables wins and ties to numbers. Using the int() function. You can show us your updated code then.
18th Feb 2025, 4:57 PM
Lisa
Lisa - avatar
+ 2
Because i forgot to put int because its an integer?
18th Feb 2025, 5:10 PM
Christian Francis
Christian Francis - avatar
+ 1
I did
18th Feb 2025, 2:56 PM
Christian Francis
Christian Francis - avatar
+ 1
Um that is what the ai said
18th Feb 2025, 4:25 PM
Christian Francis
Christian Francis - avatar
+ 1
Great! Now try to explain why this works, while the other one doesn't.
18th Feb 2025, 5:01 PM
Lisa
Lisa - avatar
+ 1
What data type were "wins" and "ties" before you applied the int() function? What does "integer" mean in common speech?
18th Feb 2025, 5:21 PM
Lisa
Lisa - avatar
+ 1
Lisa i did it okay
18th Feb 2025, 5:23 PM
Christian Francis
Christian Francis - avatar
+ 1
the task is about understanding what you did. happy coding!
18th Feb 2025, 5:31 PM
Lisa
Lisa - avatar
+ 1
You too reply to my comments
18th Feb 2025, 5:31 PM
Christian Francis
Christian Francis - avatar
+ 1
Christian Francis â„č just a reminder to convert input values before doing any calculations on them.
19th Feb 2025, 7:02 PM
Ilyas Bakirov
Ilyas Bakirov - avatar
0
Read the advice carefully, step by step. Don't guess.
18th Feb 2025, 4:52 PM
Lisa
Lisa - avatar