+ 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?

22nd Jun 2019, 2:03 PM
polargnome
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")
22nd Jun 2019, 2:10 PM
polargnome
0
Get rid of the *i?
22nd Jun 2019, 2:08 PM
Jackson O’Donnell
0
a="word" b=list(range(1,5)) for i in b: print(a=+"?" *i) if a=="word????" : break print(end)
24th Jun 2019, 5:52 AM
Sonny Angelo Regal
Sonny Angelo Regal - avatar