我正在尝试在字符串中附加字符,但我遇到了循环问题。我不知道在字符串中附加字符的命令:
import string
import random
def main():
generateRandomNumbers()
def generateRandomNumbers():
nameLength = 10
for i in range(nameLength)
x = random.choice(string.ascii_lowercase )
uname.append(x)
print (x)
size = 0
nameLength=0
if __name__ == "__main__":
main()
我收到以下错误消息:
File "Fl.py", line 8
for i in range(nameLength)
^ SyntaxError: invalid syntax
慕少森
相关分类