python在迭代多个数组时遇到问题';s
嘿,我对python还很陌生,我一直被卡住,我基本上是在尝试让它循环,而它只在一个组合上卡住python在迭代多个数组时遇到问题';s,python,arrays,random,choice,Python,Arrays,Random,Choice,嘿,我对python还很陌生,我一直被卡住,我基本上是在尝试让它循环,而它只在一个组合上卡住 import random letters = ['jaysasdfr','kileasrs','mdaawe','theuser','super','mrt','charman','allchar','ne ver','swssdord','xmasfan'] numbers = ['111','123','122','143','422','239','213','124','234''0
import random
letters = ['jaysasdfr','kileasrs','mdaawe','theuser','super','mrt','charman','allchar','ne ver','swssdord','xmasfan']
numbers = ['111','123','122','143','422','239','213','124','234''093','425','684','858','421','095','555','554','888']
extras = ['!','@','$','*','^','%','&','?','/','.','>','<']
x = random.choice(letters)
y = random.choice(numbers)
z = random.choice(extras)
t = x + y + z
while 1 == 1:
print(t)
随机导入
字母=['jaysasdfr'、'kileasrs'、'mdaawe'、'theuser'、'super'、'mrt'、'charman'、'allchar'、'ne ver'、'swssdord'、'xmasfan']
数字=['111','123','122','143','422','239','213','124','234''093','425','684','858','421','095','555','554','888']
extras=['!'、'@'、'$'、'*'、'^'、'%'、'&'、'?'、'/'、'>'、'>'、“您的问题是需要在while
循环中重新进行随机化。在您的版本中,x
、y
和z
进行设置,但不会更改,因为您的循环只包含print
语句
import random
letters = ['jaysasdfr','kileasrs','mdaawe','theuser','super','mrt','charman','allchar','ne ver','swssdord','xmasfan']
numbers = ['111','123','122','143','422','239','213','124','234''093','425','684','858','421','095','555','554','888']
extras = ['!','@','$','*','^','%','&','?','/','.','>','<']
while True:
x = random.choice(letters)
y = random.choice(numbers)
z = random.choice(extras)
t = x + y + z
print(t)
随机导入
字母=['jaysasdfr'、'kileasrs'、'mdaawe'、'theuser'、'super'、'mrt'、'charman'、'allchar'、'ne ver'、'swssdord'、'xmasfan']
数字=['111','123','122','143','422','239','213','124','234''093','425','684','858','421','095','555','554','888']
附加值=['!'、'@'、'$'、'*'、'^'、'%'、'&'、'?'、'/'、'.'、'>'、'