complete PythonX Lesson1
This commit is contained in:
@@ -1,6 +1,32 @@
|
||||
print("hello")
|
||||
|
||||
i = 100
|
||||
while(i>10):
|
||||
print(f"Value of {i}")
|
||||
i = i-1
|
||||
# sample function without input arguments and return values
|
||||
|
||||
def print_hello():
|
||||
|
||||
print('Hello WT!')
|
||||
|
||||
|
||||
|
||||
# type function name to call the function directly.
|
||||
|
||||
print_hello()
|
||||
|
||||
print_hello()
|
||||
|
||||
print_hello()
|
||||
|
||||
# sample function with input arguments and return value
|
||||
|
||||
def tree_sum(a,b,c):
|
||||
|
||||
result = a+b+c
|
||||
|
||||
return result
|
||||
|
||||
|
||||
|
||||
# call function with given values and use another variable to hold return values
|
||||
|
||||
sum1 = tree_sum(1,2,3)
|
||||
|
||||
sum2 = tree_sum(4,5,6)
|
||||
|
||||
Reference in New Issue
Block a user