Spaces:
Sleeping
Sleeping
| # 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)}") |