0

I'm a beginner in Python.. i need your help! What's the problem here?

https://code.sololearn.com/cECrIk2df2UO/?ref=app

29th Aug 2020, 8:50 AM
Riyad El Yacoubi
Riyad El Yacoubi - avatar
7 Réponses
+ 4
Check this code it's somewhat similar to your program so help yourself print("Welcome to the guess the number game\n") print("You have to guess the number\n") print("Hint : The number is of two digits\n") num=18 a=5 while a>0: guess=int(input("Enter your guessed number : ")) if guess==18: print("You won!") break elif guess>num: print("Too high") a=a-1 print("You are left with ",a,"guesses") continue elif guess<num: print("Too low") a=a-1 print("You are left with ",a,"guesses") continue else: print("You Lose")
29th Aug 2020, 9:05 AM
‎Keshav
‎Keshav - avatar
+ 3
Line 3: Remove the last close bracket) Line 7,9,10: Indentation error Give 2 spaces before these lines. Take input from user for your second question!
29th Aug 2020, 8:52 AM
Vadivelan
29th Aug 2020, 9:03 AM
Riyad El Yacoubi
Riyad El Yacoubi - avatar
+ 3
SoloLearn doesn't have an interactive console. Try it in an interactive console and your code will rock 👍👍👍 Happy coding!
29th Aug 2020, 11:27 AM
MSN
MSN - avatar
+ 2
userin=input() #leave a space after each input u1,u2=userin.split(" ") #splits two inputs print(u1," and ",u2) I think thies is the easy way to take multiple inputs SL.
30th Aug 2020, 4:07 PM
Vijay(v-star🌟)
Vijay(v-star🌟) - avatar
+ 1
No indentations after conditional statements like if and else, If something: do something Notice the space before the line after if condition Edit:Also you are missing input for Q_One as indicated by others
29th Aug 2020, 8:56 AM
Abhay
Abhay - avatar
0
Indentation error!
31st Aug 2020, 1:24 AM
Azalo Ahmat
Azalo Ahmat - avatar