Files
CS448/Homeworks/hw2/hw1.py
T
2024-03-02 11:45:26 -05:00

60 lines
1.3 KiB
Python

import sys
# Use this file to write your queries. Submit this file in Gradescope after finishing your homework.
#TODO: Write your username and answer to each query as a string in the return statements in the functions below.
# Do not change the function names.
#Make sure to test that python prints out the strings (your username and SQL queries) correctly.
#usage:python3 hw1.py
# make sure the program prints out your SQL statements correctly. That means the autograder will read you SQL correctly.
# Running the Python3 file will not execute your SQL statements (just prints them).
def username():
return "srettig" # Write your username here
def query1():
return """
"""
def query2():
return """
"""
def query3():
return """
"""
def query4():
return """
"""
#Do not edit below
def main():
query_options = {1: query1(), 2: query2(), 3: query3(), 4: query4()}
if len(sys.argv) == 1:
if username() == "username":
print("Make sure to change the username function to return your username.")
return
else:
print(username())
for query in query_options.values():
print(query)
elif len(sys.argv) == 2:
if sys.argv[1] == "username":
print(username())
else:
print(query_options[int(sys.argv[1])])
if __name__ == "__main__":
main()