ITP 150 - Python Midterm Study Guide
Questions With Correct Answers
What is a python built in function and some examples?
| | | | | | | | |
It is a function that is built-into the core Python language. Some
| | | | | | | | | | | |
common built-in functions include: print, input, and type
| | | | | | |
function definition |
a function is a block of code which only runs when it is called. You can
| | | | | | | | | | | | | | | |
pass data, known as parameters. A function can return data as a resul.
| | | | | | | | | | | |
How to create and call a function with arguments
| | | | | | | |
def test_names(first_name, sec_name):
| |
print("Hello", first_name, "and", sec_name) | | |
my_function(Mary, Claire) |
parameter or argument | |
,a variable listed inside the parentheses in the function definition
| | | | | | | | |
What is the standard python coding style
| | | | | |
snake case - lower case+underscores
| | | |
str: joe, int: 7, float: 3.90, bool: true,
| | | | | | |
name = "Joe" | |
num = 7 | |
dec = 3.90
| |
reg = True
| |
What data type is the console data/input() function
| | | | | | |
it is always a string data type however we can change this
| | | | | | | | | | |
Change the input into different data types: input("Enter age")
| | | | | | | |
str(input("Enter age")) |
int(input("Enter age")) |
,float(input("Enter age"))
|
bool(input("Enter age"))
|
True or False: Variables cannot begin with a number
| | | | | | | |
True
True or False: Python is an interpreted language
| | | | | | |
True
True or False: Python is case-sensitive
| | | | |
True
True or False: Variables names can have spaces
| | | | | | |
False
True or False: This is a proper variable name 1value
| | | | | | | | |
Questions With Correct Answers
What is a python built in function and some examples?
| | | | | | | | |
It is a function that is built-into the core Python language. Some
| | | | | | | | | | | |
common built-in functions include: print, input, and type
| | | | | | |
function definition |
a function is a block of code which only runs when it is called. You can
| | | | | | | | | | | | | | | |
pass data, known as parameters. A function can return data as a resul.
| | | | | | | | | | | |
How to create and call a function with arguments
| | | | | | | |
def test_names(first_name, sec_name):
| |
print("Hello", first_name, "and", sec_name) | | |
my_function(Mary, Claire) |
parameter or argument | |
,a variable listed inside the parentheses in the function definition
| | | | | | | | |
What is the standard python coding style
| | | | | |
snake case - lower case+underscores
| | | |
str: joe, int: 7, float: 3.90, bool: true,
| | | | | | |
name = "Joe" | |
num = 7 | |
dec = 3.90
| |
reg = True
| |
What data type is the console data/input() function
| | | | | | |
it is always a string data type however we can change this
| | | | | | | | | | |
Change the input into different data types: input("Enter age")
| | | | | | | |
str(input("Enter age")) |
int(input("Enter age")) |
,float(input("Enter age"))
|
bool(input("Enter age"))
|
True or False: Variables cannot begin with a number
| | | | | | | |
True
True or False: Python is an interpreted language
| | | | | | |
True
True or False: Python is case-sensitive
| | | | |
True
True or False: Variables names can have spaces
| | | | | | |
False
True or False: This is a proper variable name 1value
| | | | | | | | |