-1
Basically the program must check and display all prime numbers up to the entered value. I have already made a code that checks if it is prime or not (the check has to be done by a function), but I do not know how to display the numbers until the entered value.
def primo(numero):
if numero != 0 & numero != 1:
if numero > 3:
for i in range(2, numero):
if numero % i == 0:
return False
return True
return False
num = int(input("Digite um numero:"))
print("É primo" if primo(num) else "Não é primo")
From a look https://answall.com/search?q=%5Bpython%5D+primo and see if it helps.
– Augusto Vasques
Thanks guys I got.
– Victor Hugo