call function with arguments - Introduction to Python: Absolute Beginner Module 2 Video 1

Опубликовано: 29 Июль 2021
на канале: Book Simplifiers
147
4

Concept: Function with Arguments
Calling Functions with Arguments
Functions are used for code tasks that are intended to be reused
Python allows us to create User Defined Functions and provides many Built-in Functions such as print()

print() can be called using arguments (or without) and sends text to standard output, such as the console.
print() uses Parameters to define the variable Arguments that can be passed to the Function.
print() defines multiple string/numbers parameters which means we can send a long list of Arguments to print(), separated by commas.
print() can also be called directly with just its name and empty parenthesis and it will return a blank line to standard output
Example
print('Hello World!', 'I am sending string arguments to print ')
student_age = 17
student_name = "Hiroto Yamaguchi"
print(student_name,'will be in the class for',student_age, 'year old students.')
print("line 1")
print("line 2")
line 3 is an empty return - the default when no arguments
print()
print("line 4")
Task 1
Passing Arguments to print()
Many Arguments can be passed to print
update the print statement to use print() with 8 or more arguments
#[ ] increase the number of arguments used in print() to 8 or more
student_age = 17
student_name = "Hiroto Yamaguchi"
print(student_name,'will be in the class for',student_age, 'year old students.')


На этой странице сайта вы можете посмотреть видео онлайн call function with arguments - Introduction to Python: Absolute Beginner Module 2 Video 1 длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Book Simplifiers 29 Июль 2021, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 147 раз и оно понравилось 4 зрителям. Приятного просмотра!