Write a program that takes input of a number in word format like “one” or “four”. Print out the ordinal number for the input (ex: “one” → “first”, “five” → “fifth”)
Write a program that inputs a number and generates an error message if it is not a number. It should keep asking for input until it is valid.
Print this table using lists and for loops:

Create a rock-paper-scissors game that uses functions.
Create a .txt file. Write three new lines, then read the entire file.
Complete as you see fit. If you haven't completed the homework before the break yet, please focus on that first!
Resources:
Contact Info:
shravyassathish@gmail.com (mentor)
kingericwu@gmail.com (TA)
felixguo41@gmail.com (TA)
#1
number = input("Please enter a number in word format (one, two, three... five hundred thirty four) oh and please no hyphens ").lower()
number.split()
last = ""
cornerCases = {"one":"first", "two": "second", "three": "third", "five": "fifth", "eight": "eighth", "nine": "ninth", "twelve": "twelfth"}
if number[-1] in cornerCases:
last = cornerCases[number[-1]]
elif number[-1][-1] == "y":
last = number[-1][:-1] + "ieth"
else:
last = number[-1] + "th"
for i in range(0, len(number) - 1):
print(number[i], end = " ")
print(last)
#2
num = input("Please enter a number: ")
while 1:
try:
int(num)
except:
num = input("Please enter a number: ")
else:
break
#3
table = [["App", "Number of hours"], ["Discord", 5], ["Safari", 4.5], ["Messages", 1.25]]
for row in table:
for item in row:
print(item, end = " ")
print("\n")
#4
import random
choices = ["rock", "paper", "scissors"]
def rps():
user = input("Rock, paper, scissors! ").lower()
comp = random.choice(choices)
if comp != user:
if comp == "rock":
if user == "paper":
print("You won!")
else:
print("You lost.")
elif comp == "paper":
if user == "scissors":
print("You won!")
else:
print("You lost.")
else:
if user == "rock":
print("You won!")
else:
print("You lost.")
else:
print("Tie.")
if input("Wanna play rock paper scissors? ").lower() == "yes":
rps()
else:
print("Oh, ok.")
#5
input = open("file.txt", "w")
input.write("Line1\nLine2\nLine3")
input.close()
output = open("file.txt", "r")
print(output.read())