• Cursos
  • Compilador de Código
  • Debatir
  • Precios
  • 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 Respuesta
+ 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

¿Tienes a menudo preguntas como esta?

Aprende gratis de forma más eficaz

  • Introducción a Python

    7,1M de estudiantes

  • Introducción a Java

    4,7M de estudiantes

  • Introducción a C

    1,5M de estudiantes

  • Introducción a HTML

    7,5M de estudiantes

Ver todos los cursos
En tendencia hoy
How my gradient is so mess I code in vscode and copied here to ask some questions please help me with this one too
1 Votes
HELP ME LEARN
1 Votes
Please tell me about methods
1 Votes
Does anyone know how to go to another "page" on the same page using the HTML button tag?
2 Votes
Can I learn both graphic design and web development at the same time?
0 Votes
How do i learn php in here?
1 Votes
Hi everyone I hope you’re well
0 Votes
Running of python or js script (backend) and entering of html page by clicking SUBMIT button
2 Votes
Anyone’s make one brut force attack tools password breaker
0 Votes
How can I unenroll from a course I chose by mistake?
0 Votes