• Courses
  • Code Compiler
  • Discuss
  • Pricing
  • Teams
Menu
0

why is 4 being printed?

why is 4 being printed in range 1 to 10? https://code.sololearn.com/cYltglr88UM8/?ref=app

pythonprime
7th Aug 2021, 4:13 PM
Harsha S
Harsha S - avatar
1 Answer
+ 4
Harsha S Because range(2, 2) will return empty list and isPrime function will return 1 in case of 4 there should be range(2, num // 2 + 1)
7th Aug 2021, 4:21 PM
AÍąJ
AÍąJ - avatar

Often have questions like this?

Learn more efficiently, for free:

  • Introduction to Python

    7.1M learners

  • Introduction to Java

    4.7M learners

  • Introduction to C

    1.5M learners

  • Introduction to HTML

    7.5M learners

See all courses
Hot today
Fix Rivers in 2D Terrain Map Generator
5 Votes
What Is the most complicated thing you can do
1 Votes
Hello everyone, I want to learn programming, I don't know where to start.
1 Votes
How the operators and commands in this code are executed?
1 Votes
Combination
0 Votes
Will I get the certificate for free if I completed the free course of web development (I am not on pro subscription)
0 Votes
Somebody knows how to solve the problem finance app. Even my result is like it must be, but still I can't pass it
0 Votes
I finished introduction to python
0 Votes
Whyy.
0 Votes
i am begineer
0 Votes