Prime que | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Prime que

can anybody know the program to print prime no. between a given range and also only whose reverse is also prime ex. 17

3rd Sep 2017, 5:53 AM
ajeet
ajeet - avatar
5 Answers
+ 6
The you filter the list using: if a is prime and int(reverse(str(a))) is prime
3rd Sep 2017, 6:55 AM
๐Ÿ‘‘ Prometheus ๐Ÿ‡ธ๐Ÿ‡ฌ
๐Ÿ‘‘ Prometheus ๐Ÿ‡ธ๐Ÿ‡ฌ - avatar
+ 5
Use the Sieve of Erathnostenes. C++ this: https://code.sololearn.com/cCG0NiHxo8l3/?ref=app
3rd Sep 2017, 6:12 AM
๐Ÿ‘‘ Prometheus ๐Ÿ‡ธ๐Ÿ‡ฌ
๐Ÿ‘‘ Prometheus ๐Ÿ‡ธ๐Ÿ‡ฌ - avatar
+ 5
Oh.
3rd Sep 2017, 6:54 AM
๐Ÿ‘‘ Prometheus ๐Ÿ‡ธ๐Ÿ‡ฌ
๐Ÿ‘‘ Prometheus ๐Ÿ‡ธ๐Ÿ‡ฌ - avatar
+ 2
but reverse is a condition in this que
3rd Sep 2017, 6:52 AM
ajeet
ajeet - avatar
+ 1
ya. i will try
3rd Sep 2017, 6:56 AM
ajeet
ajeet - avatar