Python Review

10 Questions | Total Attempts: 118

SettingsSettingsSettings
Please wait...
Python Programming Quizzes & Trivia

This is a review quiz for the BAVC Open Source Software class. It contains questions about programming in python and open-ended questions about open source.


Questions and Answers
  • 1. 
    In programming, there are different data types...(in Python, they are stored as objects)Which one is an integer?
    • A. 

      .02

    • B. 

      "40"

    • C. 

      67

    • D. 

      12.2

    • E. 

      Str(4)

  • 2. 
    In programming, there are different data types...(in Python, they are stored as objects)Which one is a string?
    • A. 

      3.2

    • B. 

      Int("642")

    • C. 

      3

    • D. 

      "821"

    • E. 

      Apple

  • 3. 
    ["abc", 123, party]The above is an example of a _______ data/object type.
  • 4. 
    {"first_name":"Mary", "last_name":"Ann", "age":20}The above is an example of a _______ data/object type.
  • 5. 
    Fruits = ["apple","banana","coconut"]How do you print coconut, using above variable? (Python code only)
  • 6. 
    Weather_forecast = {"monday":"rainy","tuesday":"sunny","wednesday":"cloudy"}How do you print the weather for wednesday, using above variable? (Python code only)
  • 7. 
    In Python, what do you get when you multiply 23.0 by 4?Also, what kind of data/object type is it?
    • A. 

      92 => float

    • B. 

      92.0 => integer

    • C. 

      "92.0" => string

    • D. 

      92 => integer

    • E. 

      92.0 =>float

  • 8. 
    Briefly describe the following data/object types:1. Integers2. Floats3. Strings4. Lists5. Dictionaries(Hint: What kind of information do they each store?)
  • 9. 
    In programming, what is a function?Also, write a function in Python that returns "Hello World!" whenever it's called.
  • 10. 
    In programming, what is a class?Also, write a class in Python called "Person" that has a name, age, and can introduce itself (Hint: function).