calling a def statement in python code example
Example 1: python def
def foo():
print("Hello")
foo()
def add(numA, numB):
print(numA+numB)
return numA+numB
num = add(1, 5)
print(num)
Example 2: python def
def paste(a, b)
for i in b:
print(a)
while True:
paste("Python is Cool!!!", 3)
happy = "NEUTRAL"
def yes():
happy="TRUE"
print("Thank you!")
def no():
happy="FALSE"
print("That's not nice!")
answer=str(input("Do you like my new shoes? (y/n) ")
if answer=="yes" or "y" or "Yes" or "Y" or "YES":
yes()
elif answer=="no" or "n" or "No" or "N" or "NO":
no()