2
Write a program that reads a non-negative integer and print the sum of the N first prime numbers.
I am not able to add the N first prime numbers but add up to the prime number typed.
If I type 5 for example appears 2 3 5 and the sum that is 10. But in the case would have to appear 2 3 5 7 11 and the sum that would 28.
My code:
n = int(input('Digite um número inteiro positico: '))
soma = 0
for num in range(2, n + 1):
primo = True
for i in range(2, num):
if num % i == 0:
primo = False
if primo:
print(num)
soma += num
print(soma)