+ 1

How to fix my code

I just started and I can’t find out what’s wrong with my code this is my code: name=(input("whats ur name: ")) if name == "": print("I SAID WHAT'S UR NAME IDIOT!!!") else: print(f"hello {name}") try: response = (input("want sum corn? (Y/N): ")) if response == "Y": print("ok den have sum *tosses corn*") elif response == "N": print ("ok weirdo!")

2nd Jun 2024, 10:51 PM
Memphis Hall
Memphis Hall - avatar
2 ответов
+ 6
For starters you have a 'try' block without using 'except' or 'finally'. Since you just joined Sololearn today I would focus on completing the Intro to Python course that you started 😉
2nd Jun 2024, 11:42 PM
Keith
Keith - avatar
+ 2
You certainly don't need to put input in parentheses for a string. E.g. name = input("what's your name: ")
3rd Jun 2024, 6:57 AM
Ausgrindtube
Ausgrindtube - avatar