Skip to content

Instantly share code, notes, and snippets.

@ShawnMacedo
ShawnMacedo / PPExercise 2
Last active November 15, 2017 20:36
Practice Python Exercise 2 - Odd or Even
# Ask the user for a number. Depending on whether the number is even or odd, print out an appropriate message to the user.
# Hint: how does an even / odd number react differently when divided by 2?
# Extras:
# 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.
num = int(input('Please give me a number and I will tell you if it is Even or Odd'))
if num % 2 == 0:
print(' Thanks ... You entered an Even number')
elif num % 2 != 0:
@ShawnMacedo
ShawnMacedo / Exercise 1
Created October 26, 2017 19:41
Practice Python Exercises
# Create a program that asks the user to enter their name and their age. Print out a message addrewssed to them that tells them the year that they will turn 100 years old.
name = input("Enter your name:")
print("Hello " + name)
age = int(input("Enter your age:"))
age_dif = 100 - age
print(name + " You will be 100 in the year")
print(2017 + age_dif)