Python Lexical Structure :
Following is a simple Python program. It shows the basic structure of many Python scripts follows:
2. Do some processing (lines 4 – 5).
3. Make decisions and perform actions based on those decisions (lines 6 – 10).
name = “Jim”
age = 42
highschoolGPA = 3.89
print “\n\n”
if name == “Jim”:
print “Your age is “, age
print “You had a”, highschoolGPA, “GPA in high school”
if (highschoolGPA > 3):
print “You had better than a 3.0 GPA...good job!”
No comments:
Post a Comment