Ask coding questions

← Back to all posts
python with turtle
FamousRW (1)

I'm new to this and kinda stuck. can anyone help me with it

Answered by Bookie0 (4591) [earned 5 cycles]
View Answer
Bookie0 (4591)


you said:

"Im suppose to do this🔽

Using natural language, write an algorithm that does the following:
asks the user to input 3 test scores
computes the average of the test scores
If the average is less than 60%, tell the user that the average score is failing.
If the average is above 60%, tell the user that the average score is passing.
Using iteration, tell the user whether each of the 3 test scores are even or odd.
Tell the user “Thank you.” before ending the program.

The output of the program should look like this (with the blue text being what the user input):
Please enter the first test score: 70
Please enter the second test score: 85
Please enter the third test score: 90
The average score is 81.666666667
The average score is passing.
Test score number 1 is even.
Test score number 2 is odd.
Test score number 3 is even.
Thank you.

this is what you've supposed to do ^. For that you should use a python repl, no need a python turtle repl lol.

So first, you'll need 3 inputs to ask the user 3 times for their test scores. Then, use conditionals to determine if what the user wrote is bigger than 60%. For making it into 60%, use the rule of thirds:
full score -- 100%
user score -- x

so x = user score * 100 / full score.
Do the same for each of the test scores. For the average, add all the test score percentages and divide them by 3. so in the conditionals, depending on what the user got, print if the user has a score that is passing or failing.

then to find if the scores are even or pair, use the modulos (%) operator: if score1 % 2 == 0: this means that the score is even. else its odd. Same for the other scores.

Finally, you'll need a print statement to print thank you. Use break or import sys and on the line you want to stop the program sys.exit() ;)

Try to figure it out, and if you cant, reply and I will help you with the code. Lemme know if i was unclear! :D

FamousRW (1)

Help me with the code plz

Bookie0 (4591)

@FamousRW Ok I will send you the code, with comments explaining it later ;)

Bookie0 (4591)

ok here is the link:

that is the output if you do 70, 85, 90 like in the assignment

lemme know if you have questions! :)


Bookie0 (4591)

remember to check this answer as correct if it helped you! =) @FamousRW

Coder100 (11092)

What are you trying to do

Coder100 (11092)

ah, can I ask why you are using python turtle? @FamousRW