if Statements (python3) | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 1

if Statements (python3)

Anyone can explain me if Statements.

10th Aug 2020, 1:14 PM
Jash Sampat
3 Réponses
+ 4
If is used for a conditional statement Ex- num = 3 If num>1: print("hello") else: print("hi") In this code num is greater than 1 so condition is true so it will print hello Complete your course you will understand it
10th Aug 2020, 1:22 PM
Harsh
Harsh - avatar
+ 1
you can try relating it to real life. When you wake up, chances are youre more hungry than usual, IF youre hungry, go get some food, ELSE start your day. IF you are hungrey and IF there is food, you can eat, ELSE go get some food. IF you have the money, you can buy the food... and i dont like where its going, but it helps me to relate it to life sometimes.
10th Aug 2020, 2:40 PM
Slick
Slick - avatar