fork(2) download
  1. def maior_primo(n):
  2. for num in reversed(range(1,n+1)):
  3. if all(num%i!=0 for i in range(2,num)):
  4. return num
  5.  
  6. print(maior_primo(100)) # 97
Success #stdin #stdout 0.02s 27704KB
stdin
Standard input is empty
stdout
97