API thing

import requests
import csv

testing = 1

if testing == 0:
	url = "https://visual-crossing-weather.p.rapidapi.com/forecast"

	querystring = {"aggregateHours":"24","location":"Washington,DC,USA","contentType":"csv","unitGroup":"us","shortColumnNames":"0"}

	headers = {
		"X-RapidAPI-Key": "eb0bbc6cc0msh085b254f1761bc2p154cf4jsne59a8dbdbaa0",
		"X-RapidAPI-Host": "visual-crossing-weather.p.rapidapi.com"
	}

	response = requests.request("GET", url, headers=headers, params=querystring)

	f = open("./assets/weather.csv", "a")
	f.write("")
	f.write(response.text)
	f.close()

with open('./assets/weather.csv') as csv_file:
	csv_reader = csv.reader(csv_file, delimiter=',')
	line_count = 0
	for row in csv_reader:
		if line_count == 0:
			print(f'{row[0]}                              {row[9]}     {row[1]}')
			line_count += 1
		else:
			location = row[0].replace(",", " " )
			print(f'{location} is projected to be {row[9]} degrees on {row[1]} degrees.')
			line_count += 1
Address                              Temperature     Date time
Washington DC USA is projected to be 63.1 degrees on 10/13/2022 degrees.
Washington DC USA is projected to be 57.2 degrees on 10/14/2022 degrees.
Washington DC USA is projected to be 62.5 degrees on 10/15/2022 degrees.
Washington DC USA is projected to be 62.2 degrees on 10/16/2022 degrees.
Washington DC USA is projected to be 57.1 degrees on 10/17/2022 degrees.
Washington DC USA is projected to be 47.0 degrees on 10/18/2022 degrees.
Washington DC USA is projected to be 44.9 degrees on 10/19/2022 degrees.
Washington DC USA is projected to be 49.2 degrees on 10/20/2022 degrees.
Washington DC USA is projected to be 56.6 degrees on 10/21/2022 degrees.
Washington DC USA is projected to be 53.3 degrees on 10/22/2022 degrees.
Washington DC USA is projected to be 47.3 degrees on 10/23/2022 degrees.
Washington DC USA is projected to be 51.6 degrees on 10/24/2022 degrees.
Washington DC USA is projected to be 47.8 degrees on 10/25/2022 degrees.
Washington DC USA is projected to be 48.4 degrees on 10/26/2022 degrees.
Washington DC USA is projected to be 50.4 degrees on 10/27/2022 degrees.
Washington DC USA is projected to be 52.7 degrees on 10/28/2022 degrees.

Code explanation

I import the getpass library that way I can personalize it and say the user name. The function question_with_response asks the question and returns the user answer, named msg. For every question in the list questions, I pass the variable msg into rsp and send it to the gradeResponse function, along with the corresponding answer. gradeResponse will then check if the answer is correct and award a point to the user if it is. At the end of the quiz, it will display how many out of the total questions were correct.