我正在尝试在字符串中附加字符,但我遇到了循环问题。我不知道在字符串中附加字符的命令:import stringimport randomdef main(): generateRandomNumbers()def generateRandomNumbers(): nameLength = 10 for i in range(nameLength) x = random.choice(string.ascii_lowercase ) uname.append(x) print (x)size = 0nameLength=0if __name__ == "__main__": main()我收到以下错误消息:File "Fl.py", line 8 for i in range(nameLength) ^ SyntaxError: invalid syntax
添加回答
举报
0/150
提交
取消