def x1():
y = input("Input pet here: ")
if y == "pet":
return True
else:
return False
x1()
def x2():
y = input("Input pet here: ")
if y == "pet":
print(y)
else:
print("not a pet")
x2()
Output: C:\Users\jiraf\AppData\Local\Programs\Python\Python39\python.exe "C:/Users/jiraf/OneDrive/Documents/Grzegorz/Programowanie/Python/kurs/1.02/Wykład 1.8 Funkcje (definiowanie, argumenty).py"
Input pet here: shit Input pet here: shit not a pet
Process finished with exit code 0
I have tried with many easy functions that simply should return something
I have no idea why is that.