Lily09897
Badges: 9
Rep:
?
#1
Report Thread starter 7 months ago
#1
i litterally don't know how to convert pseudocode into python given when i attempt there's always an error. can someone please help.
OUTPUT “Guess the song title S... R…...’s Theme Song?”
if song != “Seth Rollins Theme Song”
OUTPUT “That’s the wrong song.”
Elif song == “Seth Rollins Theme Song ”
OUTPUT “That’s the correct song”
this is about guess the song title. if the words don't match seth rollin then its wrong other its correct.
0
reply
pwk123
Badges: 14
Rep:
?
#2
Report 7 months ago
#2
Step 1 : Convert key words i.e python doesn't have a OUTPUT but it does have print("YOUR MESAAGE")
Step 2 : Check capital letters, in general most thing in python are lower case
Step 3: Check indentation
ps as you are asking for a user input you need to set a variable and have a line i.e user_guess = input()
0
reply
Lily09897
Badges: 9
Rep:
?
#3
Report Thread starter 7 months ago
#3
(Original post by pwk123)
Step 1 : Convert key words i.e python doesn't have a OUTPUT but it does have print("YOUR MESAAGE")
Step 2 : Check capital letters, in general most thing in python are lower case
Step 3: Check indentation
ps as you are asking for a user input you need to set a variable and have a line i.e user_guess = input()
i understand what you are saying but can you please do this as an example so i can fully understand.
OUTPUT “Guess the song title S... R…...’s Theme Song?”
if song != “Seth Rollins Theme Song”
OUTPUT “That’s the wrong song.”
Elif song == “Seth Rollins Theme Song ”
OUTPUT “That’s the correct song”
0
reply
pwk123
Badges: 14
Rep:
?
#4
Report 7 months ago
#4
(Original post by Lily09897)
i understand what you are saying but can you please do this as an example so i can fully understand.
OUTPUT “Guess the song title S... R…...’s Theme Song?”
if song != “Seth Rollins Theme Song”
OUTPUT “That’s the wrong song.”
Elif song == “Seth Rollins Theme Song ”
OUTPUT “That’s the correct song”
song = input("Guess the song title S... R…...’s Theme Song?”)
if song != “Seth Rollins Theme Song”:
print("That's the wrong song!")
else:
print("That's the correct song")
0
reply
Lily09897
Badges: 9
Rep:
?
#5
Report Thread starter 7 months ago
#5
(Original post by pwk123)
song = input("Guess the song title S... R…...’s Theme Song?”)
if song != “Seth Rollins Theme Song”:
print("That's the wrong song!")
else:
print("That's the correct song")
also do you know how to allow 2 chances to guess nae of song but stopping the game if they guess a song incorrectly on the second chance it ends the game. i would also appreciate it.
0
reply
pwk123
Badges: 14
Rep:
?
#6
Report 7 months ago
#6
(Original post by Lily09897)
also do you know how to allow 2 chances to guess nae of song but stopping the game if they guess a song incorrectly on the second chance it ends the game. i would also appreciate it.
for loop
0
reply
Lily09897
Badges: 9
Rep:
?
#7
Report Thread starter 7 months ago
#7
(Original post by pwk123)
for loop
can you show me how as in using this can you give me an example so I can understand this.
song = input("Guess the song title S... R…...’s Theme Song?”)
if song != “Seth Rollins Theme Song”:
print("That's the wrong song!")
else:
print("That's the correct song")
0
reply
pwk123
Badges: 14
Rep:
?
#8
Report 7 months ago
#8
(Original post by Lily09897)
can you show me how as in using this can you give me an example so I can understand this.
song = input("Guess the song title S... R…...’s Theme Song?”)
if song != “Seth Rollins Theme Song”:
print("That's the wrong song!")
else:
print("That's the correct song")
just above the quiz code write:
for i in range(0,2):
Insert previous code here indented
0
reply
Lily09897
Badges: 9
Rep:
?
#9
Report Thread starter 7 months ago
#9
(Original post by pwk123)
just above the quiz code write:
for i in range(0,2):
Insert previous code here indented
i tried using it but it says syntax could you include for i in range(0,2): in the programs could you send me a screenshot of how you would include the for i in range(0,2): in
0
reply
X

Quick Reply

Attached files
Write a reply...
Reply
new posts
Back
to top
Latest
My Feed

See more of what you like on
The Student Room

You can personalise what you see on TSR. Tell us a little about yourself to get started.

Personalise

What support do you need with your UCAS application?

I need help researching unis (4)
7.69%
I need help researching courses (5)
9.62%
I need help with filling out the application form (3)
5.77%
I need help with my personal statement (24)
46.15%
I need help with understanding how to make my application stand out (12)
23.08%
I need help with something else (let us know in the thread!) (1)
1.92%
I'm feeling confident about my application and don't need any help at the moment (3)
5.77%

Watched Threads

View All
Latest
My Feed

See more of what you like on
The Student Room

You can personalise what you see on TSR. Tell us a little about yourself to get started.

Personalise