Chapter 2 PCEP Quiz 1ΒΆ

  1. Select 5 code segments from among:

    • )

    • print(

    • (

    • input(

    • ;

    • "Please enter a float: ")

    • int(

    • float(

    and arrange them to complete the right hand side of the assignment statement with an expression that asks the user for a float value and assigns it to the magnitude variable.

    magnitude =
    
  2. Which of the following expressions evaluate to a zero result?

    1. 4 - 3 // 2 - 3

    2. 1 ** 2 - 7 // 3

    3. 4 / 2 + 2 ** 0

    4. 2 // 5 * 3 ** 4