- 1

Can any one help me with this question

22) Write a function called primes that is given a number n and returns a list of the first n primes. Let the default value of n be 100.

22nd Jun 2021, 1:14 PM
Sai Prabhath Anyapu
Sai Prabhath Anyapu - avatar
5 Answers
+ 6
Sai Prabhath , ok - have you already done a try by yourself? if not - please do so. we need to see your code to get an idea on what the issue is. in any case: please put your code in playground and link it here. thanks and happy coding;
22nd Jun 2021, 1:19 PM
Lothar
Lothar - avatar
+ 4
Okay.... Your code has some syntax and indention errors. And.... you append too soon. Append after x%i == 0 fails for all numbers. You do directly after first fail and get too much numbers. Here the code for cheating https://code.sololearn.com/cjUNp5EFR3TM/?ref=app
22nd Jun 2021, 1:37 PM
Oma Falk
Oma Falk - avatar
+ 2
Sai Prabhath i think u copied this code.
22nd Jun 2021, 1:26 PM
Oma Falk
Oma Falk - avatar
22nd Jun 2021, 1:22 PM
Sai Prabhath Anyapu
Sai Prabhath Anyapu - avatar
0
No
22nd Jun 2021, 1:27 PM
Sai Prabhath Anyapu
Sai Prabhath Anyapu - avatar