Please all my python program I always have error invalid syntax help me | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
0

Please all my python program I always have error invalid syntax help me

19th Aug 2020, 6:32 PM
victor bamidele
victor bamidele - avatar
20 Réponses
+ 17
Please post your code, so thatwee can help you. Thanks!
19th Aug 2020, 6:36 PM
Lothar
Lothar - avatar
+ 8
number=4 Guess=int(input("enter ur number")) if Guess == number: print ("right")
19th Aug 2020, 6:44 PM
Julia Shabanova
Julia Shabanova - avatar
+ 5
i think your code should be like this..... number = 4 guess=int(input("enter ur number: " )) if guess == number: print("right") else: print("wrong")
20th Aug 2020, 5:26 AM
Tanvir [Inactive]
Tanvir [Inactive] - avatar
+ 3
Print or print?Then you use python2 or python3?guess/Guess???python is case sensitive
19th Aug 2020, 7:05 PM
HBhZ_C
HBhZ_C - avatar
+ 2
Did you change If to if?
19th Aug 2020, 6:53 PM
Julia Shabanova
Julia Shabanova - avatar
+ 1
number=4 Guess=int (input ("enter ur number")) # in the next line here, you use If instead of if. You also use 'guess' instead of 'Guess' which you define in the line above. Python is case-sensitive. If guess ==number # should be print and not Print Print ("right") In my interpreter, Python gives me the location of the error: File "guess.py", line 3 If guess == number: ^ SyntaxError: invalid syntax (it's a g instead of a G) Unfortunately, Python cannot fix it for me - I have to do that myself. But it's a great way to learn by my mistakes :)
19th Aug 2020, 9:32 PM
Colin Frame
Colin Frame - avatar
+ 1
Guess != guess there is one line code: print('right' if int(input()) == 4 else 'wrong')
20th Aug 2020, 11:43 AM
Yurii Ostapenko
Yurii Ostapenko - avatar
+ 1
I don't know what is wrong with the code editor solo learn provides, when you run a code it does not show what you want. Always showing errors.
20th Aug 2020, 7:38 PM
Victor Dickson
Victor Dickson - avatar
+ 1
number=24 guess=int(input("enter the age: ")) if guess==number: print ("u guess it right") #the while block stop elif guess>number: print ("it is a little lower than that") else: print ("wrong") while guess==quit: break victor bamidele
21st Aug 2020, 8:42 AM
Sevda Krithika Sharma
Sevda Krithika Sharma - avatar
+ 1
Post your code use other compiler solo learn python compiler not work perfectly
21st Aug 2020, 9:11 AM
Sourc3 Cod3r
Sourc3 Cod3r - avatar
0
number=4 Guess=int (input ("enter ur number")) If guess ==number Print ("right")
19th Aug 2020, 6:41 PM
victor bamidele
victor bamidele - avatar
0
Error pointing on gusee
19th Aug 2020, 6:48 PM
victor bamidele
victor bamidele - avatar
0
First understand you we get which error it will help to fix it easily. https://www.tutorialsteacher.com/JUMP_LINK__&&__python__&&__JUMP_LINK/error-types-in-python
19th Aug 2020, 7:13 PM
Divya Mohan
Divya Mohan - avatar
0
@S M Mahmudal Hasan Search on YouTube and you'll get it
21st Aug 2020, 6:43 AM
Raghu Rao
Raghu Rao - avatar
0
hay i know your problem you might be not giving proper space between statements
21st Aug 2020, 10:29 AM
Anmol.
0
Definitely you might face the problem that I had faced already. It is called the indentation in Python. That means you need worry abt spaces and blocks. Indentation in Python refers to the (spaces and tabs) that are used at the beginning of a statement. The statements with the same indentation belong to the same group called a suite. Consider the example of a correctly indented Python code statement mentioned below. For more details: https://www.programiz.com/python-programming/statement-indentation-comments
21st Aug 2020, 10:56 AM
Bits!
0
Share your code @Victor bamidele
21st Aug 2020, 10:59 AM
Raghu Rao
Raghu Rao - avatar
0
Code ?
21st Aug 2020, 1:03 PM
R3D4DD1
R3D4DD1 - avatar
- 1
Syntax error:invalid syntax
19th Aug 2020, 6:50 PM
victor bamidele
victor bamidele - avatar
- 1
Nirman High school is inviting you to a scheduled Zoom meeting. Topic: Maths Ch-6 Fractions Time: Aug 21, 2020 11:00 AM Login time: 10:55 AM Class : 4th E & F Join Zoom Meeting https://us04web.zoom.us/j/76500027254?pwd=OWpISjRTeG44bzZvWFN6MmVEVnQzUT09 Meeting ID: 765 0002 7254 Passcode: 4z0k5m
21st Aug 2020, 5:39 AM
kinnari patel
kinnari patel - avatar