menu

Python Control Structures


1. Which of the following statements is used to call a function in Python?

call function_name(arguments)

function_name.call(arguments)

function_name(arguments)

arguments(function_name)


2. Which of the following statements is used to check if a number is a multiple of another number in Python?

num % multiple == 0

num / multiple == 0

num % multiple == 1

num / multiple == 1


3. Which of the following statements is used to import a module in Python?

module.import(module_name)

import module_name

from module_name import *

All of the above


4. Which of the following statements is used to break out of nested loops in Python?

continue

pass

break

exit


5. Which operator is used to check if two values are equal in Python?

=

==

===

!=


6. Which statement is used to create a set in Python?

[ ]

( )

{ }

| |


7. Which statement is used to return a value from a function in Python?

return

exit

break

pass


8. Which of the following statements is used to create a function in Python?

def function_name(arguments):

function function_name(arguments):

function_name(arguments) def:

function_name def(arguments):


9. Which keyword is used to define a block of code in Python?

block

segment

suite

module


10. Which statement is used to skip the current iteration of a loop in Python?

break

continue

pass

skip