+ 1

Write python program to print the following:

1 13 135 1357

16th Feb 2019, 3:32 PM
mystic
7 Respostas
+ 4
If you want to share this to community as a challenge then please head onto lesson factory. Else if you want to know how to do this share your attempt first. You have to practice yourself https://www.sololearn.com/discuss/1316935/?ref=app
16th Feb 2019, 3:56 PM
Seniru
Seniru - avatar
+ 3
string = “” for i in range(1,8,2): string += str(i) print(string)
16th Feb 2019, 3:58 PM
Russ
Russ - avatar
+ 3
Data Breach range(1,8,2) is a generator function that returns, in order 1, then 3, 5 and lastly 7. range() takes the format range([start limit],[end limit],[difference]). So here, the start is 1, end is 8 and difference is 2.
16th Feb 2019, 4:36 PM
Russ
Russ - avatar
+ 2
a = 1 print(a) b = 13 print(b) c = 135 print(c) d = 1357 print(d) simple mode :)
16th Feb 2019, 3:37 PM
Ivan
+ 2
Data Breach no, it prints the wanted pattern, because fist time the var string is 1, then 13, 135 and at the end 1357.
16th Feb 2019, 4:09 PM
Maneren
Maneren - avatar
+ 1
Russ that prints 182? does it not?
16th Feb 2019, 4:00 PM
Ivan
+ 1
ohhhhh okay thank you Russ
16th Feb 2019, 4:46 PM
Ivan