0
Please all my python program I always have error invalid syntax help me
22 odpowiedzi
+ 17
Please post your code, so thatwee can help you. Thanks!
+ 8
number=4
Guess=int(input("enter ur number"))
if Guess == number:
print ("right")
+ 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")
+ 3
Print or print?Then you use python2 or python3?guess/Guess???python is case sensitive
+ 2
Did you change If to if?
+ 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 :)
+ 1
Guess != guess
there is one line code:
print('right' if int(input()) == 4 else 'wrong')
+ 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.
+ 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
+ 1
Post your code use other compiler solo learn python compiler not work perfectly
0
number=4
Guess=int (input ("enter ur number"))
If guess ==number
Print ("right")
0
Error pointing on gusee
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
0
@S M Mahmudal Hasan
Search on YouTube and you'll get it
0
hay i know your problem
you might be not giving proper space between statements
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
0
Share your code @Victor bamidele
0
Code ?
- 1
Syntax error:invalid syntax
- 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