Discussion Assignment

practice with loops, functions and input


1. Write a Python program that reads an integer num from the user, and prints the integers between num and the square of num. Read the input in your main function, and then call another function to compute and display the output. E.g., if num is 3, your program should print:
3 4 5 6 7 8 9


2. Write a program that reads a positive integer num from the user (print an error message of the value is not positive), and then prints a table that contains, for each integer i from 1 to num, the values i, i/2 (integer division), and i/float(2). That is, if num is 10, print this table:

Number                 Number/2                       Number/float(2)
-----------------------------------------------------------------------------------------------------
     1                             0                                           0.5
     2                             1                                           1.0

...

   10                            5                                            2.0