0

How can I get c variable value inside the for x in range? Code

str1=1
str2=100
n=int(input('vvedite kolichestvo: '))#4
r=7
while str1<str2:
  str1=str1+1
  for i in range(n):#4
    i=i+1#3
    globals()['summ{}'.format(r+i)] = r+i
    c=globals()['summ{}'.format(r+i)]
    print(c)
        for x in range(1, c+1):
           print(f"6 and {((x-1)%10)+1} and {(x - 1) // 10} and {x}")

If c=8, then inside the for x in range (1, n): print(f"6 and {((x-1)%10)+1} and {(x - 1) // 10} and {c}")

mozway
  • 194,879
  • 13
  • 39
  • 75

0 Answers0