+ 4
Chess Tournament Python code
Hi all i cant get any further with below objective. Input example Wins = 2 Ties = 1 Expected output Score: 7 Im stuck at sololearn with below code and cant get any further. Can anyone please explain what im doing wrong? # Convert the values into numbers wins = int(input()) ties = int(input()) # 1 win = 3 points # 1 tie = 1 point # Calculate the score score = 6+1 # Concatenate the 2 strings to produce a message message = "Score: " + str(score) # Display the message print(message)
6 Respostas
+ 5
B Ö ,
score = 6+1
above is the line that causes the problem. the values are `hard-coded`. this means that the calculation uses fixed nunbers, but we should use the 2 input values `wins` and `ties`.
`pseudo code` that should do the task properly:
score = (number of wins * 3) + (number of ties *)
+ 3
You have only solved if the points equal 7.
The program takes 2 inputs and you need to output them as a sum.
Every win needs to be multiplied by 3, then the ties can be added on. Then you print the result.
+ 2
You did not explain how the program is supposed to work. All we have is that “wins and ties are supposed to go in, and something happens that isn’t addition, then a score is output.” What is the program supposed to do?
+ 2
B Ö You’ve been told what to do. If you don’t know how to do it, it means you need to go back and take the preceeding lessons again.
+ 1
Chess tournament
We are making a program that neds to calculate th point earned by a chess player in a tournament.
A win = 3 points
A tie = 1 point
Task:
Complete the program to convert te inputted values into numbers, then calculate and out the points earned by the player.
0
Can you please show me how to fix the code?