Create a dictionary that corresponds a letter to a set of numbers for grades (A = 100-90, B = 89-80, etc). Take user input for a letter and then print the appropriate grade range.
Write a function to reverse all the characters of a string. (Hint: lists)
Write a function that takes in a length in inches and converts it to centimeters.
Resources:
Class slides: https://docs.google.com/presentation/d/1YE65GPWYQF5Uefdguci73FnjEpDUbN1qJX60acT1UMU/edit#slide=id.g18c35fbbda7_0_142
Class code: https://replit.com/@ShravyaS/IntroToPython-Class10#main.py
Contact Info:
shravyassathish@gmail.com (mentor)
kingericwu@gmail.com (TA)
felixguo41@gmail.com (TA)
grades = {"A": range(90, 100), "B": range(80, 89), "C": range(70, 79), "D": range(60, 69), "F": range(0, 59)}
print(grades.get(input("Part 1: Please input letter grade to exchange: ").upper()))
def reversal(string):
chars = []
for i in range(len(string), 0, -1):
chars.append(string[i-1])
return "".join(chars)
print(reversal(input("Part 2: Please input a string to reverse: ")))
def metricify(length):
return float(length)*2.54
print(metricify(input("Part 3: Please input a length (in inches) to convert to centimeters: ")))