Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def suman(sumka, k):
- if sumka % k == 0:
- return False
- else:
- return True
- plik = open('napis.txt')
- j = 2
- p = 0
- while True:
- suma = 0
- napis = plik.readline()
- if len(napis) == 0:
- break
- for i in napis:
- suma += int(ord(i))
- for j in range(2,suma):
- if suman(suma, j) == True:
- p += 1
- print("Napisow pierwszych w pliku jest ", j)
- plik.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement