0
What is wrong in this code?
a=100 b=20 if(a>b) Print(a) Else Print(b)
4 Answers
+ 6
if(a>b):
else:
You forgot ":"
"else" and "print" - from small letters
+ 5
Nikita Dua
you forgot the colons (:)
no parentheses in a>b
Change Else to else
Change Print to print
Correct Code:
a = 100
b = 20
if a > b:
print(a)
else:
print(b)
+ 2
#this is corrected:
a=100
b=20
if(a>b):
print(a)
else:
print(b)
+ 1
Nikita Dua
In python, : and indentations are very important.
1. You forgot to add : after your if/else.
2. print starts with lowercase 'p'.
Just make these changes and your code will work fine..
It happens to all programmers. Keep practicing and you will learn to self-correct such syntactical errors.



