Python

No description

fork
loading
Files
  • main.py
main.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
from time import *
from random import randint
def func(n):
  n=int(n)
  j=0
  for i in range(int(len(str(n)))):
    j+=int(str(n)[i:i+1])
  n=int(n-j)
  if int(n) % 9==0:
    sleep(0.1)
    return(n/9)
  else:
    sleep(0.1)
    return("No")
    
def run1():
  a=0
  while True:
    a+=1
    print(str(func(a)))
    if str(func(a))=="No":
      break

def create():
  g=randint(1,100)
  g=g*9
  j=randint(1,8)
  k=g+j
  s=0
  for i in range(int(len(str(k)))):
    s+=int(str(k)[i:i+1])
  if s==j:
    print(s,j)
    return("Yes")
  else:
    print(s,j)
    return("No")

for a in range(100):
  print(func(a))
  create()
  sleep(1)
  print()