Ask coding questions

← Back to all posts
I dont get what is wrong??
AA12341 (0)

I dont get whats wrong on line 68?

Answered by Carnage498 (57) [earned 5 cycles]
View Answer
Comments
hotnewtop
Carnage498 (57)

@AA12341 you wrote the first question very wrong. your kinda confusing python. Try it like this:
def question_1():
print("Python Quiz")
question1 = ("how do you output Hello World ")
choices1 = ("1. print('Hello World') \n2. print(Hello World) \n3.console.log('Hello world')\n4.say('Hello world')")
print(question1)
print(choices1)
response = input("type '1', '2', '3' or '4' for your answer\n")

if response == "1":
print("Correct")
else:
print("Incorrect!!! Try again.")
question_1()
question_1()
Because you added 2 if statements for "if" like this:
if response == "1":
break

if True == "1":
  print("correct")

which makes it break instead of continue since python reads from top to bottom. hopefully it helps =) ~ @Carnage498

AA12341 (0)

@Carnage498 I really appreciate your help!!

Carnage498 (57)

no problem @AA12341 I have been doing this for quite a while :) Happy it helped

VulcanWM (2883)

I don’t see any error.

AA12341 (0)

Whats wrong with the else:???

Carnage498 (57)

on my screen line 68 is blank @AA12341