Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

Computer Programming

Assignment I

1. Define a function that takes the age of a person as an argument and checks the
type of the argument. The function also prints out the age.
Then invoke(call) the function.
Example output: Int
Your age is 20!

2. Define a function that takes a number and prints the square of the number. Then
invoke(call) the function.
Example output: The square of the number 5 is 25

3. Define a function that takes a number and prints the log of the number. Then
invoke(call) the function. Import the necessary module!
Example output: The log value of the number 10 is 1

4. What should be the value of “X” for this expression to be TRUE? Explain your
answer.
X or 4 == 5 or 2>5 and True
5. What should be the value of “Y” for this expression to be TRUE? Explain your
answer.
X and 8 != 3 or 2<5 or True

You might also like