programming-fundamentals
  • Introduction
  • Lesson 1
    • Writing Your First Program
    • Data Types
    • Built In Functions
    • If Statements
    • Using Git and Github
    • Primer
    • Questions
    • Tip Calculator
    • GPA Calculator (optional)
  • Lesson 2
    • Modules
    • Lists
    • Data Structures
    • More On Data Structures
    • Questions
    • Madame Zamad
    • Mad Libs
  • Lesson 3
    • While Loops
    • For Loops
    • Loops and Lists
    • Special Commands
    • Questions
    • TODO List
    • Fibonacci (optional)
  • Lesson 4
    • Functions
    • More Functions
    • Error Handling
    • File I/O
    • Questions
    • Sudoku
Powered by GitBook
On this page

Was this helpful?

  1. Lesson 1

Questions

  • What is the command to execute a Python program?

  • How do you create a multi-line comment?

  • Can comments go at the end of a line of code?

print('hello world')  # a print statement
  • What is the difference between an integer and a floating point?

  • What values can a boolean be?

  • What is the difference between "42" and 42?

  • How do operators relate to operands?

  • Write an expression that includes operator(s) and operand(s).

  • What are the rules for variable names and give 5 examples of valid variable

    names?

  • How can you turn a string into an integer?

  • What goes on the inside of an if condition (the part inside the

    parentheses)?

  • What programming construct could you use to do something different based on

    three possible values (i.e. small, medium, large)?

  • What is the difference between = and ==?

  • What does the variable pancakes hold after the following expression:

pancakes = 42
pancakes + 8
  • How do you clone a remote Git repository?

  • How do you change the current directory in the terminal?

  • How do you check the current status of your Git repository?

  • The following expression causes an error. How can you make it work?

print("I learned to ride a bike when I was " + 4 + " years old")
PreviousPrimerNextTip Calculator

Last updated 5 years ago

Was this helpful?