Skip to main content
Back

Decision and Repetition Structures in Python Programming

Study Guide - Practice Questions

Test your knowledge with practice questions generated from your notes

  • #1 Multiple Choice
    Which of the following best describes a decision structure in programming?
  • #2 Multiple Choice
    Given the following code, what will be the output if the user enters 25 for 'hours' and 10 for 'pay_rate'? if hours > 40: overtime_hours = hours - 40 overtime_pay = overtime_hours * pay_rate * 1.5 gross_pay = 40 * pay_rate + overtime_pay else: gross_pay = hours * pay_rate print('The gross pay is $', format(gross_pay, ',.2f'), sep='')
  • #3 Multiple Choice
    Which of the following Boolean expressions will evaluate to True if $x = 5$ and $y = 10$?

Study Guide - Flashcards

Boost memory and lock in key concepts with flashcards created from your notes.

  • Decision Structures and Boolean Logic
    21 Questions
  • Repetition Structures
    18 Questions