В моем коде появляется ошибка «ValueError: требуется больше, чем 1 значение для распаковки» при запуске бесконечного цикла while с получением вопросов до тех пор, пока пользователь не начнет выходить из него. Любую подсказку имеет еще одна ценность?Продолжайте получать ValueError при работе в цикле
from random import shuffle
questions = [
("Which organization develops the 802 family of standards for wired and wireless LANs and MANs?", "ieee"),
("What type of delivery uses data link layer addresses?", "local delivery"),
("What organization developed the OSI reference model that is used in networking?", "iso"),
("Which message delivery option is used when all devices need to receive the same message simultaneously?", "broadcast"),
("Which type of network design combines voice, video, and data on the same communication channel?", "converged"),
("During a routine inspection, a technician discovered that software that was installed on a computer was secretly collecting data about websites that were visited by users of the computer. Which type of threat is affecting this computer?", "spyware"),
("Which device acts as a gateway to allow hosts to send traffic to remote IP networks?", "local router"),
("What will a network administrator use to modify a configuration on a Cisco router?", "ios"),
("To save time, IOS commands may be partially entered and then completed by typing which key or key combination?", "tab"),
("An administrator measured the transfer of usable data across a 100 Mb/s physical channel over a given period of time and obtained 60 Mb/s. Which kind of measurement did the administrator obtain?", "goodput"),
]
shuffle (questions)
numRight = 0
numQuest = 0
wrong = []
print ("Welcome to my computer networking Quiz, based on Cisco material.")
while True:
for questions, rightAnswer in questions:
answer = input(questions + " ")
if answer.lower() == rightAnswer:
print("Congratulations, that is the right answer!")
numRight += 1
numQuest += 1
answer2 = input("Would you like to continue? Type yes or no: ")
if answer2.lower() == "no":
break
else:
print("That is the wrong answer my friend!")
numQuest += 1
answer2 = input("Would you like to continue? Type yes or no: ")
if answer2.lower() == "no":
break
a = numRight
b = numQuest
def stats(a,b):
return a/b*100
if stats(a,b) >= 60.0:
print("You got", stats(a,b), "percent right. You pass!")
else:
print("You got", stats(a,b), "percent right. You fail!")
Пожалуйста, сократите это до [минимального примера] (http://stackoverflow.com/help/mcve) и обеспечите полную отслеживание ошибок. – jonrsharpe