Week 1 Flashcards
What are values in programming?
A specific piece of data or information that a program can use, store, manipulate, or pass around.
What are expressions in programming?
A combination of values, variables, operators, and functions that can be evaluated or computed to produce another value
What are statements in programming?
A single instruction or command that a program executes.
What is an interpreter in Python?
A program that reads a high level programming language and executes the instructions one line or statement at a time.
What is the correct way to format floating point numbers in a print statement?
Print(f”{e:.#f}”)
With # as the number of decimal places
What function is used to get user input?
The input() function
What function is used to convert strings to integers?
The int() function
What function is used to convert strings to floating point numbers?
The float() function
What operator is used to do floor division?
The // operator
What does _ mean in python?
It is a variable representing the last printed expression
Are strings considered mutable or immutable?
Immutable
What built in objects are considered false?
Constants “None” and “False”
Zero of any numeric type
Empty sequences and collections
Do comparison or Boolean operators have higher priority?
Comparison operators
What are the three distinct numeric types?
Int, float, complex
How are constants formated in Python for CS 111?
Upper snake case