The Student Room Group

ict pseudocode to python

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.
Reply 1
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()
Reply 2
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”
Reply 3
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")
Reply 4
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.
Reply 5
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
Reply 6
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")
Reply 7
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
Reply 8
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

Quick Reply

Latest