Tuesday, March 31, 2009

Python Lexical Structure :

Following is a simple Python program. It shows the basic structure of many Python scripts follows: 

  1. Initialize variables (lines 1 – 3). 

  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

enteredName = raw_input(“Enter your name: “)
   
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:

Data Science - 103 (Kapil Sharma)

Cloud Computing Basic:-  In this the PC is on service provider data center and secuirty maintenance and upgrades are done by the service pro...