Using Functions

There are two important things to remember when using functions with arguments. The first thing is that the order matters. For example, the random.randint() function takes in two arguments. The first is the minimum value, and the second is the maximum value. If you put them in correctly, you get a random number:
import random
number = random.randint(1, 10)
print(number)
# random number between 1 and 10
But if you reverse the order and try to put the larger number first, you will get an error:
import random
number = random.randint(10, 1)
print(number)

# Traceback (most recent call last):
#   File "main.py", line 2, in <module>
#     number = random.randint(10, 1)
#   File "random.py", line 370, in randint
#     return self.randrange(a, b+1)
#   File "random.py", line 353, in randrange
#     raise ValueError("empty range for randrange() (%d, %d, %d)" % (istart, istop, width))
# ValueError: empty range for randrange() (10, 2, -8)
The second thing is that the data type matters in many cases. The random.randint() function works fine with integers, but if you try to use floats or strings, you will get an error:
import random
number = random.randint(1.5, 10.6)
print(number)

# Traceback (most recent call last):
#   File "main.py", line 2, in <module>
#     number = random.randint(1.5, 10.6)
#   File "random.py", line 370, in randint
#     return self.randrange(a, b+1)
#   File "random.py", line 309, in randrange
#     raise ValueError("non-integer arg 1 for randrange()")
# ValueError: non-integer arg 1 for randrange()

Exercise 1 of 5

Call the function with the correct argument.
# name must be a string
def say_hello(name):
  print("Hello " + name)

Your code

Exercise 2 of 5

Call the function with two numbers as arguments.
def add_numbers(a, b):
  print(a + b)

Your code

Exercise 3 of 5

Call the function with the correct arguments so the function prints True.
def is_less_than(a, b):
  print(a - b < 0)

Your code

Exercise 4 of 5

Call the function with the correct arguments.
def describe_person(name, age):
  future_age = str(age + 4)
  print("In four years, " + name + " will be " + future_age + " years old")

Your code

Exercise 5 of 5

Call the function three times to check the hours 4, 7, and 13.
def get_time_period(hour):
  if hour < 12:
    print("AM")
  else:
    print("PM")

Your code