Practice Quiz: Hello World

Practice Quiz: Hello World

11. What are functions in Python?

  • Functions let us use Python as a calculator.
  • Functions are pieces of code that perform a unit of work.
  • unctions are only used to print messages to the screen.
  • Functions are how we tell if our program is functioning or not.

12. What are keywords in Python?

  • Keywords are reserved words that are used to construct instructions.
  • Keywords are used to calculate mathematical operations.
  • Keywords are used to print messages like “Hello World!” to the screen.
  • Keywords are the words that we need to memorize to program in Python.

13. What does the print function do in Python?

  • The print function generates PDFs and sends it to the nearest printer.
  • The print function stores values provided by the user.
  • The print function outputs messages to the screen
  • The print function calculates mathematical operations.

14. Output a message that says "Programming in Python is fun!" to the screen.

  • print(“Programming in Python is fun!”)

15. Replace the ___ placeholder and calculate the Golden ratio: 1+√5/2

Tip: to calculate the square root of a number x, you can use x**(1/2).

ratio = ___
print(ratio)

  • ratio = (1 + 5**(1/2)) / 2
    print(ratio)

Devendra Kumar

Project Management Apprentice at Google

Leave a Reply