我想创建一个变量[Word],它包含字母列表中的一个单词,但不包括任何括号、空格或逗号。
这是我已经到了:
Letters = ["u", "i", "p","a","o","g", "h","j","k","l","z","x","v","b"]
FirstLetter = -1
SecondLetter = 'o'
ThirdLetter = 'a'
FourthLetter = 'l'
Endletter = 0
while FirstLetter < 13:
FirstLetter = FirstLetter +1
Word = (Letters[FirstLetter], SecondLetter,ThirdLetter,FourthLetter,Letters[Endletter])
print(Word)
第一行的输出为:
('u', 'o', 'a', 'l', 'u')
我想要:
uoalu
对不起,如果这是已经回答了我已经尝试了堆的建议,但不能得到它
1条答案
按热度按时间mkshixfv1#
如果要将一个字符串连接为单个字符串,则应使用
join()
。