0

How to create a list? Python

That conrains only prime numbers in range (0, n)

31st Mar 2019, 7:57 AM
AlexanderAPS
AlexanderAPS - avatar
3 odpowiedzi
+ 8
There are two ways to create list in python 1st way with square brackets like this.......e.g.👇👇 var=[1, 2, 5, 8, "Sam", 6.2] 2nd way... Using list function.......... e.g. 👇👇 var=list(1, 2, 3, 5, 8, "Sam", 6.2)
31st Mar 2019, 8:21 AM
Mohd Abdul Sameer
Mohd Abdul Sameer - avatar
+ 3
hi, in python there is no “ready to use” function or class for handling prime numbers. But you can have a look at this code challenge: https://www.sololearn.com/learn/969/
31st Mar 2019, 9:02 AM
Lothar
Lothar - avatar
0
No. So i have a number N. I want to create a list, that contains all prime numbers <=N. So like [2,3,5,7,11,13,17] etc.
31st Mar 2019, 8:37 AM
AlexanderAPS
AlexanderAPS - avatar