-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.py
69 lines (47 loc) · 1.24 KB
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# import sys
# CURSOR_UP_ONE = '\x1b[1A'
# ERASE_LINE = '\x1b[2K'
# def delete_last_lines(n=1):
# for _ in range(n):
# sys.stdout.write(CURSOR_UP_ONE)
# sys.stdout.write(ERASE_LINE)
# print("Hello")
# delete_last_lines()
# import sys
# import time
# def delete_last_line():
# "Use this function to delete the last line in the STDOUT"
# #cursor up one line
# sys.stdout.write('\x1b[1A')
# #delete last line
# sys.stdout.write('\x1b[2K')
# ########## FOR DEMO ################
# if __name__ == "__main__":
# print("hello")
# print("this line will be delete after 2 seconds")
# time.sleep(2)
# delete_last_line()
# import time
# from datetime import datetime
# def clock():
# while True:
# print(datetime.now().strftime("%H:%M:%S"), end="\r")
# time.sleep(1)
# clock()
import time
from random import randint
def rand():
print("Ready, Set, Go.....!")
time.sleep(1)
numbers = []
print("\n ")
for i in range(0, 4):
roll = randint(0, 9)
if roll not in numbers:
numbers.append(roll)
print(" " + str(roll), end="\r")
time.sleep(1)
elif roll in numbers:
continue;
print(numbers)
rand()