# Yixuan Sun
# 9/20.2021
# I learn how to creating a simple function with a parameter
# the difficulties is hard to understand I solve it by reread it
print('Hello World!', 'I am sending string arguments to print ')
# python allow us to create user defined fuction
student_age = 17
student_name = "Hiroto Yamaguchi"
print(student_name,'will be in the class for',student_age, 'year old students.')
# pythin allow us to create user defined function
print("line 1")
print("line 2")
# line 3 is an empty return - the default when no arguments
print()
print("line 4")
# python allow us to create user defined function
# use print to create 8 more argument
student_age = 17
student_name = "Hiroto Yamaguchi"
teacher_name = "Brenne Sun"
class_name = "python"
class_time = "morning"
class_end = "afternoon"
good_class = "it is very good"
second_studentname = "Yixuan"
print()
print(student_name,'and',second_studentname,'will be in the class for',class_name,'teacher is',teacher_name,"when",class_time,"end",class_end,good_class)
# defines a function named say_hi
# use def statment when creating a function
def say_hi():
print("Hello there!")
print("goodbye")
# define three_three
# use def statement when creating a function
def three_three():
print(33)
# Program defines and calls the say_hi & three_three functions
# [ ] review and run the code
# calling fuction
def say_hi():
print("Hello there!")
print("goodbye")
# end of indentation ends the function
# define three_three
def three_three():
print(33)
# calling the functions
say_hi()
print()
three_three()
# define a variable called phrase
def phrase():
print("PHRASE!")
# calling the function
yell_it()
print()
# function parameter
# yell_this() yells the string Argument provided
def yell_this(phrase):
print(phrase.upper() + "!")
# call function with a string
yell_this("It is time to save the notebook")
# function parameter
# use a default argument
def say_this(phrase = "Hi"):
print(phrase)
say_this()
say_this("Bye")
# define variable words_to_yell as a string
def words_to_yell(phrase ="what is your name ?"):
print(phrase)
# call yell_this with words_to_yell as argument
words_to_yell()
words_to_yell("Yixuan")