This commit is contained in:
louiscklaw
2025-01-31 20:57:47 +08:00
parent ed177c5ad6
commit fc6f79b133
341 changed files with 201064 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
def say_hello():
print('Hello World!')
def area_of_square(length):
return length**2
def area_of_circle(radius):
pi = 3.1415926
return pi*radius**2
# pi can also be defined outside of the function
# good and bad?
# what if someone change the value outside?
def area_of_rectangle(length,width):
return length*width
def app():
age = int(input('What\'s your age?'))
print('Your age is {}'.format(age))
print('-------')
app()
app()