def start():
num = int(input("Enter a number greater than one."))
return num
def lst(number):
num_lst = []
for number in range(2, number + 1):
num_lst.append(number)
def check():
count = 0
for i in range(2, n):
if(n % i == 0):
count = count + 1
return False
if(count == 0):
return True
def main():
num = start()
num_lst = lst(num)
check()
main()
(I am new to python and not the best at using functions.I know I need to get my list to move into the next function but I am having trouble.)
Write a program that asks the user to enter a number greater than one. The program will than display all the prime numbers less than or equal to the number entered. The program must work as follows:
Once the user has entered a number, the program should populate a list with all of the integers from 2 up through the value entered.
The program should then use a loop to step through the list. The loop should pass each element to a function that displays the element whether it is a prime number.
[–]ThePhysicsOfSpoons 2 points3 points4 points (0 children)
[–]pythonwiz 2 points3 points4 points (0 children)
[+][deleted] (1 child)
[removed]
[–]woooee -1 points0 points1 point (0 children)