Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Create a Python program to read in a file (Qsand0pts.txt) of quiz questions and

ID: 3814698 • Letter: C

Question

Create a Python program to read in a file (Qsand0pts.txt) of quiz questions and answers into a list. Each question set is stored inside the file using 3 lines. The first line contains the questions itself. The second line contains the choices for the question. The choices are separated by two characters, a dot and underscore; each question may have a different number of choices. The choices should be displayed with the number associated with them, starting with number one. The third line contains the number of the correct choice. Each question set should be stored as a tuple in the list. Display all of the question sets to the screen in the following format: 1. Question 1) First option 2) Second option 3) Third option 2. Question 1) First option 2) Second option 3) Third option ... Read in a file of names (names.txt). As you read each name, choose 5 unique and random questions from the questions file. Store the questions in a set. Enter the name into a dictionary where the name is the key and the set of questions is the value. Print the names and questions neatly to the screen where the questions are in ascending order. Judy Questions 3, 8, 15, 17, 22 Marta Questions 1, 2, 3, 4, 5 Martin Questions 17, 20, 21, 23, 28 … Save the dictionary to a file called ‘togive.txt’. Each name and question set should be stored on one line in the file.

THE FILE: (Sorry, i have no idea how to attach files)

Why are manhole covers round in shape?

The cover cannot fall through if it is circular._Circular covers do not need to be precisely aligned._A round cover is easy to move and roll._Human beings have a roughly circular cross section._All of the above.

5

What is the result of dividing 3 by 4?

1.33333...._0.75._12._7._7._0.7777777777777

2

In the series 1,2,3,4,5,...100, how many of these numbers have the digit 7 in them?

9._10._19._20._11

3

What is the result of dividing 4 by 3?

1.33333...._0.75._12._7._7._0.7777777777777

1

Which operator makes the statement true? 1.1 x 8 (?) 10

>._<._=

2

Which operator makes the statement true? 6 (?) 2 x 2.3

>._<._=

1

Which operator makes the statement true? 3 x 1.5 (?) 4.5

>._<._=

3

Rick has 90 more bouncy balls than Abby. Abby has b bouncy balls. Choose the expression that shows how many bouncy balls Rick has.

90 - b._b._90._b + 90

4

Matthew earned b bonus points. Tara earned 59 more bonus points than Matthew. Choose the expression that shows how many bonus points Tara earned.

b + 59._b - 59._59 - b._59

1

Dave ate g out of 36 gumdrops. Choose the expression that shows how many gumdrops Dave has left.

g + 36._g - 36._36 - g._36 + g

3

What is the name of the insect which makes honey?

Honey fly._Bee._Mosquito

2

What word is the Spanish word for 'quick' and is used in English to mean 'at once'?

Pacy._Pronto._Rapido._Orale._Andale

2

Cantaloupe, Galia, and Honeydew are types of which fruit?

Berry._Orange._Melon._Avocado

3

What word for the outflow of a river is also the word for a bathroom sink?

Tub._Taza._Basin._Bucket

3

In America the Golden Gate Bridge is a feature of which city?

Chicago._New York._Dallas._San Francisco

4

Mother Theresa of Calcutta was awarded a Nobel prize for what?

Looking after poor children._Physics._Peace.-Literature._Medicine

3

Cantonese and Mandarin are languages which originated in which country?

Spain._England._Scotland._China._Brasil

4

In the game 'rock, paper,scissors', what beats paper?

Rock._Paper._Dynamite._Scissors._Water

4

In the anime NARUTO, Captain Yamato uses WOOD style ninjutsu because he can combine what 2 basic elements?

Water and Wind._Fire and Wind._Earth and Water._Earth and Fire._Earth and Wind

3

In the anime BLEACH, How many squads are in the Soul Society Protection Squads?

7._10._13._88._21

3

In any encarnation of the Justice League, what 2 characters are always present?

Wonder Woman & Cyborg._Shazam & Firestorm._Superman & Batman._Green Lantern & Flash

3

In Marvel's X-MEN, what is the codename of the one with adamantium claws?

Beast._Wolverine._Bishop._Arcangel._Sabretooth

2

How many amendments to the U.S constitution are in operation today?

10._13._27._7

3

What is the name of the Texas Tech fight song?

Victory Raiders!._Raider War Song._Hail Raiders!._Fight, Raiders, Fight

4

What is the name of the primary Texas Tech Red Raider mascot?

The Masked Rider._Red._The Red Horseman._Raider Red

1

What was the Texas Tech nickname from 1925-1936, before its athletes became known as Red Raiders?

Aggies._Cowboys._Matadors._Roughriders._Rangers

3

In the sitcom, 'The Big Bang Theory', from what Texas area is Sheldon Cooper?

West Texas._East Texas._South Texas._Texas Panhandle

2

How many states currently make up the United States of America?

48._49._50._51

3

Explanation / Answer

A)

with open("file.txt", "r") as ins:
array = []
for line in ins:
array.append(line)
inp = file.txt
data = open(inp)
dat = data.read()
lst = dat.splitlines()
print lst