# [ ] input avariable: age as digit and cast to int
# if age greater than or equal to 12 then print message on age in 10 years
# or else print message "It is good to be" age
age = (int(input("How old are you?")))
if age >= 12:
print("In 10 years you will be", age+10)
else:
print("It is good to be", age)
# [ ] input a number
# - if number is NOT a digit cast to int
# - print number "greater than 100 is" True/False
number = (int(input("Enter a number")))
if number > 100:
print("True")
else:
print("False")
# [ ] create check_guess()
# call with test
def check_guess(letter="f",guess=input("Enter a letter:")):
if guess.isalpha():
if guess>letter:
print("Your guess is high.")
elif guess<letter:
print("Your guess is low.")
else:
print("Nailed it!!")
else:
print("Please enter a letter")
check_guess()
# [ ] call check_guess with user input
# [ ] create letter_guess() function, call the function to test
def letter_guess(letter="f",guess=input("Enter a letter:")):
if guess.isalpha:
if guess!=letter:
print("Try again!")
guess=input("Enter a letter:")
if guess!=letter:
print("Try again!")
guess=input("Enter a letter:")
if guess!=letter:
print("Wrong! Out of guesses...")
else:
print("Finally!!!")
else:
print("Got it")
else:
print("Got it")
else:
print("Enter a number.")
letter_guess()
# [ ] complete pet conversation
def about_pet(pet=input("What kind of pet do you have?")):
if pet == "dog":
print("Ah, a puppy")
elif pet =="cat":
print("Alright meow!")
else:
print("Thats an interesting pet...")
about_pet()