Menu

Sub Programs - Code Quiz

1. The sub program is defined, then called, and then the main program carries on. What is printed?

def greet(): print('Hello from the sub program') greet() print('Back in the main program')
Hello from the sub program
Back in the main program Hello from the sub program
Back in the main program
Hello from the sub program Back in the main program

2. Both calls use the same sub program. What is printed?

def multiply(num1, num2): print(num1 * num2) multiply(12, 16) multiply(100, 11)
192
1100 192
192 1100
28 111

Log in or sign-up to access the quiz



Don't have a login?

You can still revise this topic