M
M
madwayz13372018-01-29 12:57:50
Python
madwayz1337, 2018-01-29 12:57:50

There is a set of numbers in a column. How to convert them to one line and separated by commas?

You need to generate a lot of numbers. For example:
for x in range(0, 99999)
They are obtained like this:
112
2123
3123
412321
How to make them look like this?
112, 2123, 3123, 412321
These numbers must be assigned to the numbers variable and used in the function as deleteMSG(numbers)

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Vladimir, 2018-01-29
@vintello

spisok = [x for x in range(0, 99999)]

A
Alexander Movchan, 2018-01-29
@Alexander1705

From the description of the problem, it sounds like you need to use an array .

Z
zayacnk, 2018-01-29
@zayacnk

import random

nums = random.sample(range(100), 10)
nums_str = ','.join(str(x) for x in nums)
print(nums)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question