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

Hormones regulate both the male and female reproductive systems. The principal male sex hormone is testosterone and is produced in the testes. Secretion of test
Chloe has been offered a new job in the women’s shoe department at Macy’s. She has two salary options. She can receive a salary of $600 per week (Option 1), or
-7(3b+4)+(22b-2)=0 solve and show steps
2 (1/3x - 3) + 2 = 4/5x - 2
Find the zeros of f(x) = (x -3)^2 - 49
Which two organs help to break food down mechanically?
Why is maintaining a healthy lifestyle important answers?
What is the stimulus that causes the ear to respond as sense organs?
change 2x+3y=1470 to to slope intercept form. identify the slope and the y- intercept
How has religion evolved since early people