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

Veröffentlicht am: 29 Juli 2021
auf dem Kanal: Book Simplifiers
146
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.')


Auf dieser Seite können Sie das Online-Video call function with arguments - Introduction to Python: Absolute Beginner Module 2 Video 1 mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Book Simplifiers 29 Juli 2021 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 146 Mal angesehen und es wurde von 4 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!