Python Essentials 1: BASICS


Module-4


                   

1 - A function definition starts with keyword?

Solution: def

2 - A function definitio?

Solution: must be placed before the first invocation

3 - A function parameter is a kind of variable accessible?

Solution: Only inside the function

4 - A way of argument passing in which the order of the arguments determines the initial parameters' values is referred to as:

Solution: Positional

5 - Which of the following statements is false?

The "return" keyword forces the function to restart its execution.

The "None" keyword designates:


Solution: a "None" value

7 - A variable defined outside a function


Solution: may be read, but not written (something more is needed to do so)

8 - If a list passed into a function as an argument, deleting any of its elements inside the function using the "del" instruction:


Solution: Will affect the argument

What is the output of the following snippet? def fun (in=2, out=3) : return in * out print (fun (3) )

Solution: the snippet is erroneous

10 - What is the output of the following snippet? tup = (1, ) + (1, ) tup = tup + tup print (len (tup) )

Solution: 4