Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import time
- def prime_number():
- result = '1'
- num = 2
- while len(result) <= 10000:
- is_dev = False
- for j in range(2, num):
- if num % j == 0:
- is_dev = True
- if not is_dev:
- result += str(num)
- num += 1
- return result[:10000]
- def prime_number1(count_symbols):
- result = '1'
- num = 2
- while len(result) <= count_symbols:
- for j in range(2, num):
- if num % j == 0:
- break
- else:
- result += str(num)
- num += 1
- return result[:count_symbols]
- start_time1 = time.time()
- prime_number1(10000)
- first = time.time() - start_time1
- start_time1 = time.time()
- prime_number()
- second = time.time() - start_time1
- print(first, second)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement