PY
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
#Created by Annihilate
import random
t = 100 #Number of digits in each sequence
s1 = "".join(str(random.randint(0,1)) for _ in range(t)) #Sequence 1: random.randint(0, 1)
print(s1)
print("\n")
s2="".join("0" if random.random()<0.5 else "1" for _ in range(t)) #Sequence 2: random.random()
print(s2)
print("\n")
s1_zc = s1.count("0") #Sequence 1 zero count
s1_oc = t - s1_zc #Sequence 1 one count
s2_zc = s2.count("0") #Sequence 2 zero count
s2_oc = t - s2_zc #Sequence 2 one count
print(s1_zc)
print(s1_oc)
print("\n")
print(s2_zc)
print(s2_oc)
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run