Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
M

Member 12247860

@Member 12247860
About
Posts
1
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • python - tail stuck under the rocks?
    M Member 12247860

    More python indention confusion ???

    # Python program to check if the input number is prime or not

    num = 15

    take input from the user

    num = int(input("Enter a number: "))

    prime numbers are greater than 1

    if num > 1:
    for i in range(2,num):
    if (num % i) == 0:
    print(num,"is not a prime number")
    print(i,"times",num//i,"is",num)
    break
    else:
    #print(num % i)
    print(num,"is a prime number")

    if input number is less than

    or equal to 1, it is not prime

    else:
    print(num,"is not a prime number")

    What the heck is that else: statement doing out there, who does it belong to? :)

    The Lounge help python business tutorial question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups