Академический Документы
Профессиональный Документы
Культура Документы
Study Guide
Module 1: Basics
Module 2: Built-in function and operators
Module 3: Modules, functions and built-in modules
Module 4: Decision structures
Module 5: Strings, lists and tuples
Module 6: Dictionaries and sets
Module 7: File processing
Module 8: Exceptions and Pickling
Module 9: Classes ad inheritance
Module 10: Iterators, recursions, and data structures
``
Module 1: Basics
1. Define a function (name it displacement) that accepts the 2 floating point numbers
(name them velocity and t_travel), computes and returns the value of
velocity + 0.5*g*t_travel2 , where g = 9.8067.
2. Define a function (name it swap) that will accept 2 values, swap their values and return
the swapped values.
3. Define a function (name it threeRandoms) that will return the three random integers
between 25 and 85.
4. Define a function (name it employeeInfo) that will accept from user a string
representing name, an integer representing the refno and a string representing the
dept. The function to return values of name, refno and dept.
5. Define a function (name it circlePoint) that will accept 2 values representing radius and
arcangle (a) of a circle and uses xCoord = radius*cos(arcangle) and yCoord =
radius*sin(arcangle) to compute and return the x and y coordinates of a point on the
circle.
6. Define a function (name it amort) that will accept 3 values, representing the principal
(p), annual percentage rate (r%) and number of years (n) of a investment, compute
and return the total investment amount after n years using the formula
12∗n
a= p∗(1+r /1200) .