2. Programming Fundamentals

Syntax And Types — Quiz

Test your understanding of syntax and types with 5 practice questions.

Read the lesson first

Practice Questions

Question 1

Which of the following best describes a situation where a variable's type is checked at runtime?

Question 2

What is the primary characteristic of a weakly typed programming language?

Question 3

Consider the following pseudocode:

function outerFunction():
    x = 5
    function innerFunction():
        y = 10
        print(x)
    innerFunction()
    print(y)


What would be the expected output due to scope rules?

Question 4

Which of the following operations demonstrates implicit type conversion (coercion)?

Question 5

What is the result of the following Python expression: $ \text{len}(\text{str}(12345)) $?