Spaces:
Sleeping
Sleeping
File size: 331 Bytes
a89f25d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
# Python Example: Input and Output
name = input("What is your name? ")
age = int(input("How old are you? "))
print(f"Hello {name}!")
print(f"You will be {age + 1} next year!")
# Calculate factorial
def factorial(n):
if n <= 1:
return 1
return n * factorial(n - 1)
print(f"Factorial of {age} is {factorial(age)}") |