1

Jul 24, 2015

Python Tutorial : If Else condition

Here is the syntax for if else condition in Python:

pencils = 80
students = 20
distribution=pencils/students
if distribution>=4 :   print("OK")
else:    print("NOT OK")

This code checks whether every student get minimum 4 pencils or not. If yes, then print "OK" or print "NOT OK".


No comments:

Post a Comment

Related Post

Related Posts Plugin for WordPress, Blogger...