Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit e035320

Browse files
author
Atul Kushwaha
committed
method added
1 parent 2cfa043 commit e035320

File tree

2 files changed

+24
-23
lines changed

2 files changed

+24
-23
lines changed

‎Random.py‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
def randomnum():
2+
#importing datetime module
3+
import datetime #inbuilt module
4+
time_now = datetime.datetime.now()
5+
#getting time in terms of microseconds
6+
random_seed = time_now.microsecond
7+
# an equation which returns a number between 0 and 10 & takes an integer as a parameter
8+
seed = random_seed * 8 % 11
9+
#making random number somewhat unpredictable !!!
10+
random_micro_secs = []
11+
for i in range(seed):
12+
random_micro_secs.append(time_now.second**seed)
13+
seed_2 = sum(random_micro_secs)
14+
#generating final random number
15+
truely_random_num=(seed_2 * 8 % 11)
16+
print(truely_random_num)
17+
18+
19+
20+
21+
22+
23+
24+

‎random by coderatul.py‎

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /