# Carmela Dorantes
# 19 September 2021
#In this lesson I learned how to use the return function with multiple parameters.
#I did have trouble with task one because I forgot to do return and the name parameter but fixed it by placeing them.
# Message double returns the string Argument doubled
#defines msg_double
def msg_double(phrase):
double = phrase + " " + phrase
return double
# save return value in variable
#phrase is replaced, function call, and message is displayed
msg_2x = msg_double("let's go")
print(msg_2x)
# example of functions with return values used in functions
#msg_double is defined again
def msg_double(phrase):
double = phrase + " " + phrase
return double
# prints the returned object
#"Save now! Save now!" is displayed
print(msg_double("Save Now!"))
# echo the type of the returned object
#displays that it is a str
type(msg_double("Save Now!"))
def make_doctor(name):
full_name= "Doctor" + name
return full_name
name= input("Enter your full name:")
print(make_doctor ( name))
#Review and run the code
# set 3 parameters defining make_schedule
def make_schedule(period1, period2):
schedule = ("[1st] " + period1.title() + ", [2nd] " + period2.title())
return schedule
student_schedule = make_schedule("mathematics", "history")
print("SCHEDULE:", student_schedule)
#
def make_schedule(period1, period2, period3):
schedule=("[1st]" + period1.title() + ", [2nd]" + period2.title() + ", [3rd]" + period3.title())
return schedule
student_schedule = make_schedule("mathematics", "history", "science")
print("SCHEDULE:" , student_schedule)
#making a 6 class schedule with previous coding
def make_schedule(period1, period2, period3, period4, period5, period6):
schedule=("[1st]" + period1.title() + ", [2nd]" + period2.title() + ", [3rd]" + period3.title() + ", [4th]" + period4.title() + ", [5th]" + period5.title() + ", [6th]" + period6.title())
return schedule
student_schedule = make_schedule("mathematics", "history", "science", "english", "chorus", "physical education")
print("SCHEDULE:" , student_schedule)