Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math
- start_num = int(input("Adja meg az elso szamot: "))
- end_num = int(input("Adja meg az utolso szamot: "))
- sum_of_all = 0
- if start_num == 1:
- start_num += 1
- for analyzed_num in range(start_num,end_num):
- analyzed_num_divisible = False
- for divider_num in range(2,int(math.sqrt(analyzed_num)) + 1):
- if analyzed_num % divider_num == 0:
- analyzed_num_divisible = True
- if analyzed_num_divisible == False:
- print("prime:",analyzed_num)
- sum_of_all += analyzed_num
- print(f"Prim szamok osszege: {sum_of_all}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement