+0  
 
-1
337
1
avatar

So I wrote this:

print("Hello There! Welcome 69Bot. What's your name?")
x = input()
print("Hello there, "+x "Are you a student or teacher?")
if input == "student" or "Student":
    print("Welcome! Please enter the class code provided by your teacher:")
elif input == "Teacher" or "teacher":
    print("Welcome! Please enter the class code you would like to go to:")
else:
    print("Please enter a valid option")
 

 

however, the first problem is it says invalid syntax on the quotation mark after the "+x" here print("Hello there, "+x "Are you a student or teacher?")

the second problem is that it automatically assumes you are a student and doesnt take the elif. How can I modify the code so as to fix these two problems? It gives this after you enter your name instead of stopping to see if you entered student or teacher:

 

Hello there! Are you a student or teacher?
Welcome! Please enter the class code provided by your teacher:

 

Thank you!

 Dec 8, 2020
 #1
avatar
0

Sorry, but from my knowledge this is a math forum, maybe visit stack overflow or one of those coding websites. But I'm sure there are a few smarties that have coding as their forte

 Dec 8, 2020

7 Online Users

avatar
avatar
avatar
avatar