Question: Task 2 ( of 2 ) : Knowing your team A set of questions were generated by a Generative AI and then saved to the

Task 2(of 2): Knowing your team
A set of questions were generated by a Generative AI and then saved to the following file:
TeamQuestion.txt. This file consists of a large number of possible questions. You are asked to
write a Python script HW3p2_Task2_UCusername.py to randomly extract N questions from this
file. At the beginning of your script, an input statement should be used to ask the user how many
questions to extract. Then, the script should open the TeamQuestion.txt file, use a random number
generator to identify a random question, print the random question to the python shell and then
have an input statement to ask if the printed question should be used. If the answer is yes, the
question should be written to a new file ('QuestionsToAsk.txt'). If the user does not want the
question asked, nothing should be written to the new file. The program should then loop around
and identify a new random question until N questions have been accepted.
To identify a random line, you will need to have the following lines in your code:
import random
LineSelect = random * randint (0, NumberOfLines )
Where Number of lines is the total number of Questions in the TeamQuestion.txt file. Line select
will then be the extracted line from the TeamQuestion.txt.
The example below is done using the random line select option, thus your script will not identify
the same questions, but should be in a similar format.
 Task 2(of 2): Knowing your team A set of questions were

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!