Хорошо, если вы запустите приведенный ниже код в Python, он печатает только первую букву переменной вопроса, однако остальное печатает просто отлично. Это происходит только тогда, когда у меня есть функция цикла внутри моего скрипта Python. Любые идеи о том, как это исправить, чтобы я получил весь вопрос переменной печати?
import random
global nouns
global verbs
global question
nouns =["website","browser","server","printer","computer","disc","software","desktop","a internet connection","the internet","site","forum","smf forum","phpbb forum","money making website","money making blog","firefox","chrome","opera","",""]
verbs = ["cosntruct","build","create","design","update","reconstruct","clean","fix","repair","browse","discover","formualte","form","plan"]
question = ["How do I","How would I", "how do i", "how would i", "what is a", "what is the", "how would i", "how should i", "when does a", "When does a", "How should I"]
def q_gen():
global nouns
global verbs
global question
noun_pick = random.choice(nouns)
verb_pick = random.choice(verbs)
question = random.choice(question)
create = question+" "+verb_pick+" "+noun_pick+"?"
print create
num_count = 0
for num_count in range(1, 100):
num_count=num_count+1
q_gen()