Skip to content

Commit 8c8a3bf

Browse files
committed
stepic ex
1 parent 995b874 commit 8c8a3bf

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

stepic/cryptographic_random.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import os
2+
import secrets
3+
4+
results = os.urandom(10)
5+
# print([hex(b) for b in results])
6+
7+
traffic_lights = ["Red", "Yellow", "Green"]
8+
# print(secrets.choice(traffic_lights))
9+
10+
byte_results = secrets.token_bytes(8)
11+
print(byte_results)
12+
13+
hex_results = secrets.token_hex(8)
14+
print(hex_results)
15+
16+
url_results = secrets.token_urlsafe()
17+
print(url_results)

0 commit comments

Comments
 (0)