Chapter 3: Compiling and running your first program

Program 3.1, Page number: 11

In [1]:
print("Programming is Fun.")
Programming is Fun.

Program 3.2, Page number: 14

In [2]:
print("Programming is Fun.")
print("And Programming in Python is even more fun")
Programming is Fun.
And Programming in Python is even more fun

Program 3.3, Page number: 14

In [3]:
print("Testing...\n..1\n...2\n....3\n")
Testing...
..1
...2
....3

Program 3.4, Page number: 15

In [4]:
        
sum=50+25
print("The sum of 50 & 25 is: {0} ".format(sum))
The sum of 50 & 25 is: 75 

Program 3.5, Page number: 16

In [5]:
value1=50
value2=25

#Calculation
sum=value1+value2

#Result
print("The sum of {0} & {1} is: {2}".format(value1,value2,sum))
The sum of 50 & 25 is: 75

Program 3.6, Page number: 17

In [6]:
value1=50
value2=25

#Calculation
sum=value1+value2

#Result
print("The sum of {0} & {1} is {2}".format(value1,value2,sum))
The sum of 50 & 25 is 75