LAB 1

An Introduction to Python

Basic Programming on Python

Interactive Mode:

Making a program

Source Code:

print (‘Hello World’)
print (‘Goodbye’)

Output:

An Example Program

Source Code:

message = ‘And now for something completely different’
number = 17
pi = 3.1415926535897932
a_boolean = True
a_list = [4, 1, 3, 5, 6, 9, 2, 11]

print ‘The string store in the message is ==> ‘, message
print ‘The number stored in N is ==>’, number
print ‘The number (this is a float) stored in pi is ==> ‘, pi
print ‘The Boolean value stored in a_boolean is ==> ‘, a_boolean
print ‘The list has the following elements:’
for element in a_list:
print ‘ –> ‘, element

Output:

Getting Help: