Write a program that allows the user to select from one of the following tasks. After the task runs, the user should be able to select another task. There should also be an option to end the program when they are done.

Task #1 Simple Divisibility Test

Determine if a number, n, is evenly divisible by a number, m. Both n and m are entered by the user. The program should prompt the user for both numbers and then report if n is evenly divisible by m.

Task #2 Prime Test

Report if a user entered integer is prime. The user should be prompted for the number. When displaying the result to the display, be sure to be descriptive so that the program is user friendly.

Task #3 Factors

This task should ask the user to enter a positive integer, and report all positive integers that are a factor of the user entered number. If zero or a negative number is entered, the user should be informed that the number is not positive and be prompted to repeatedly enter an integer until a positive integer is entered.

i have this project and am not a tech or science major so i am totally confused with this project. please help me

I found a flaw when you input 4 it says that is prime but it is actually a composite number at 10:19. This is because the square root of 4 is 2 so it skips over 2 and marks it prime, the initial state of it.

I made it on python 3.3 but i had to change it. Here's what i did:

def prime(number): if number<2: return False for factor in range(2, int(number**.5)+1): if number%factor==0: return False return True

print(prime(1)) # This will print(False)

1.Return False if number less than 2 2.Return False if number%factor==0 for factor in range 2 and sqrt(number) (If sqrt(number) is a fraction round it up) 3.Return True if you reach the end

If user give 2

https://youtu.be/6ir8VgLy36s

Man can you make a program that you put in the rank of a prime number (Ex. the 2nd prime number) and it gives you 3?(3 is the second prime)

luufa duufa duufa difoo! Bing bang billababingbong!

This system is flawed at 10:20 you can see that it says 4 is prime. It isn't.

line 7, in <module>

for factor in range(2, number ):

TypeError: 'str' object cannot be interpreted as an integer

WHat's that IDE ??

r u using sublime?

What if your trying to find the prime factors of a users input?

totally farts at 4:18

The Main Program

Write a program that allows the user to select from one of the following tasks. After the task

runs, the user should be able to select another task. There should also be an option to end the

program when they are done.

Task #1

Simple Divisibility Test

Determine if a number, n, is evenly divisible by a number, m. Both n and m are entered by the

user. The program should prompt the user for both numbers and then report if n is evenly

divisible by m.

Task #2

Prime Test

Report if a user entered integer is prime. The user should be prompted for the number. When

displaying the result to the display, be sure to be descriptive so that the program is user friendly.

Task #3

Factors

This task should ask the user to enter a positive integer, and report all positive integers that are a

factor of the user entered number. If zero or a negative number is entered, the user should be

informed that the number is not positive and be prompted to repeatedly enter an integer until a

positive integer is entered.

i have this project and am not a tech or science major so i am totally confused with this project. please help me

I had to cast the input method to an integer. Its maybe because I'm working on an older version of python

I found a flaw when you input 4 it says that is prime but it is actually a composite number at 10:19. This is because the square root of 4 is 2 so it skips over 2 and marks it prime, the initial state of it.

I evaluated the following in IDLE with a discrepancy that you might be able to explain to me:

>>>def is_prime(n):

for i in range(3, n):

if n % i == 0:

return False

return n

>>>filter(is_prime, range(3,50))

[3, 4, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47]

What the heck is the number '4' doing in there?

I made it on python 3.3 but i had to change it. Here's what i did:

def prime(number):

if number<2: return False

for factor in range(2, int(number**.5)+1):

if number%factor==0: return False

return True

print(prime(1)) # This will print(False)

1.Return False if number less than 2

2.Return False if number%factor==0 for factor in range 2 and sqrt(number)

(If sqrt(number) is a fraction round it up)

3.Return True if you reach the end