Class Review Flashcards
True or False: Python is a proprietary, expensive, difficult-to-learn language owned by Microsoft?
False
What is a literal?
A hard-coded instruction - literally this string, this number, etc.
What is the character for single-line comments?
#
What is the escape sequence for a single quote within a string?
'
‘I don't want eggs for breakfast.’
What is the character limit for a single line according to the Python Style Guide?
79 characters
What are the three keywords for conditional “IF” flow control structures?
if, elif, else
Does python use braces for controlling application flow?
No - it uses tabs - spacing!
Does python use static or dynamic data typing for variables? (Hint: duck typing)
Dynamic typing - duck typing - if it walks like a duck and acts like a duck… it’s a duck!
What do we call objects that can return their members one at a time?
Iterables
What are Python lists similar to in other languages?
Arrays
Which types of sequences are immutable?
Tuples, strings
What are generator expressions?
Iterables that can only be iterated through once
When files are read into python, what does python store them in?
File objects
What are the different options to sort on with the sorted function?
Existing functions, lambda functions, reversed
Does python provide keywords for handling exceptions?
Yes! Try, except, else, finally.