This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Ask the user for a number. Depending on whether the number is even or odd, print out an appropriate message to the user. | |
#If the number is a multiple of 4, print out a different message. | |
#Ask the user for two numbers: one number to check (call it num) and one number to divide by (check). If check divides evenly into num, tell that to the user. If not, print a different appropriate message. | |
while True: | |
try: | |
num = int(input("Please input number : ")) | |
check = int(input("Please input divide number :")) | |
if num % 4 == 0: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Create a program that asks the user to enter their name and their age. | |
#Print out a message addressed to them that tells them the year that they will turn 100 years old. | |
from datetime import datetime | |
current_year = datetime.now().year | |
while True: | |
try: | |
name = str(input("Name :")) | |
if len(name) == 0: |
NewerOlder