Im trying to make a maths quiz on python but it says a speech mark is a Syntax Error

33 views Asked by At
            print ("Congratulations for Completing the School Subject Quiz.")
            print (" ")
            print ( name  " Your score is " + score )
            print (" ")
            print ("Thank you very much for taking your time and completing my quiz")
            print (" ")
            print ("Hope you have a great day ")

it says that the second speech mark on Where it tells them there name and there score. Help Would be greatly appreciated.

2

There are 2 answers

0
Peter Morris On

You are missing the + between name and " Your score is

Without that symbol it looks like you are trying to print a variable named name(space)(quote)(space)Your - when what you are trying to print is the expression name (plus) a literal string

0
Sheena On

Even better would be f-strings.

print ("Congratulations for Completing the School Subject Quiz.\n")
print (f"{name} Your score is {score}\n" )
print ("Thank you very much for taking your time and completing my quiz\n")
print ("Hope you have a great day ")