+ 1
PYTHON 3 Loop adding "?" to a word
As title suggest, I want to add and print a word + "?" n times as my sequence. Here follows my code: a="word" b=list(range(1,5)) for i in b: print(a) a=a + "?" *i if a=="word????" : break print(end) Output just print odd number of "?". Any help?
3 Réponses
+ 1
Ok sorry, I did it.
For whom interested:
a= "word"
b=list(range(0,5))
for i in b:
print(a+"?"*i)
if a=="word????":
break
print("end")
0
Get rid of the *i?
0
a="word"
b=list(range(1,5))
for i in b:
print(a=+"?" *i)
if a=="word????" :
break
print(end)