ICP1 - sirisha1206/Python GitHub Wiki

Name:Naga Sirisha Sunkara

Class ID:36

Email Id:[email protected]

Professor:Yug Yung Lee

1.Differences between Python 2 and Python 3

Integer division

  Python 2:

    print '5 / 2 =', 5 / 2     output:2

  Python 3:

    print ('5 / 2 =', 5 / 2 )    output:2.5

Print function

  Python 2:

     print 'Hello world!!!'

  Python 3:

     print ('Hello world!!!')

Parsing input

  Python 2:

  input1 = raw_input('enter a number: ')

  Python 3:

  input1 = input('enter a number: ')

Code snippet to get the current version we are using:

Output:

2a. Code snippet to print the first name and last name in reverse order.

Output:

2b. Code snippet to find the quotient and remainder of user given number. Output:

3.Code snippet for number guess exercise using random module. Output: