Sie sind auf Seite 1von 1

Python for Marketing & Sales: Assignment 2

1. Create a user defined function to compute y = x2 and print the output. X can be any object type
that you choose.
2. Construct a prime number checker
3. Create a function called Analytics. Inside this function create two more functions. The first
function should do the sum and this sum should be input to the second function. The output of
the second function should be the cube of the input.
4. Using a while loop generate an arithmetic progression which is a list of 5 elements.
5. Define a global variable X = 100. Construct a function in which the global variable changed is 25
and after coming out of the loop the programme must print the following output “Global
variable X = 25”
6. Generate 10 random numbers from a uniform distribution between 10 and 25. Compute the
exponential of these random numbers. Also reshape the output as a 5 x 2 matrix.

Das könnte Ihnen auch gefallen