+ 5

How can I print elements in a for loop variable in an inline format instead of block?

for loop

11th Dec 2019, 8:05 PM
Divine Darkey
Divine Darkey - avatar
8 ответов
+ 4
print(*[i for i in range(1,11)])
11th Dec 2019, 8:41 PM
rodwynnejones
rodwynnejones - avatar
+ 4
WhyFry and ~ swim ~ thanks for your answers both worked!
11th Dec 2019, 10:35 PM
Divine Darkey
Divine Darkey - avatar
+ 2
Use a list comprehension
13th Dec 2019, 2:49 AM
Codebeast**
Codebeast** - avatar
0
(54*78)
12th Dec 2019, 1:43 PM
Jampala Sandhya
Jampala Sandhya - avatar
0
تز
13th Dec 2019, 10:55 AM
Zsa Zsa