Complete the function double_number(num) that takes one number parameter and returns double that number.
For example, double_number(5) should return 10.
def double_number(num):
# TODO: Return double the input number
# Example: double_number(5) should return 10
pass
What distinguishes a terminal-based Python environment from other development environments?
Complete the function format_name(first, last) that takes a first name and last name and returns them combined as " last, first " .
For example, format_name( " John " , " Smith " ) should return " Smith, John " .
def format_name(first, last):
# TODO: Return the name in " last, first " format
pass
Complete the function calculate_tip(bill, tip_percent) that calculates and returns the tip amount based on the bill and tip percentage.
For example, calculate_tip(50, 20) should return 10.0.
def calculate_tip(bill, tip_percent):
# TODO: Calculate and return the tip amount
pass
Which action allows a Python script located in a different folder to be executed in the terminal?
Which loop structure processes every individual item in a list called grades?
Fix the missing function call in this function that should return the uppercase version of a string.
def make_uppercase(text):
return text.upper
Which tool is used to execute Python code line-by-line interactively within a terminal?
What does the string method ' ' .join() return when applied to the list [ ' Hello ' , ' World ' ]?
Write a complete function reverse_string(text) that takes a string and returns it reversed.
For example, reverse_string( " hello " ) should return " olleh " .
def reverse_string(text):
# TODO: Return the reversed string
pass
Which Python data structure automatically prevents duplicate values from being stored?
A program uses this while loop to count down:
count = 5
while count > 0:
print(count)
Which issue is preventing the loop from working correctly?