yuffltf3869 yuffltf3869
  • 08-09-2017
  • Computers and Technology
contestada

Prime numbers. write a program that prompts the user for an integer and then prints out all prime numbers up to that integer.

Respuesta :

prevost400 prevost400
  • 09-09-2017
userInt = int(input("Please enter an integer: "))

x = 0
for number in range():
    # if x divides evenly into 0 and 1 but not into 2
    # and x is less than the user entered number
    if x % x == 0 and x % 1 ==0 and x % 2 != 0 and x <= userInt:
        print(x)
        x = x + 1

# I think this'll work

Answer Link

Otras preguntas

3(27 - 12) i need it simplified
i have trouble dividing​
Por qué la goegrafía estudia más que un lugar y sus dimensiones?
explain the difference between an Expression and an Equation.
Please help !! Is this quote imagery or a metaphor
Which word in the sentence is a verb ? Bella is my best friend
Corals form symbiotic relationships with microscopic photosynthetic algae that live in their cells and give the corals their distinct colors. The relationship i
True or false England was the only European nation attempting to settle the east coast at the time
piz help fast!!!!!! thx​
The allowance for doubtful accounts is reported as an __________ on the balance sheet.