Daily questions 2019.9.15

Coding. 8 = UTF-# 
Import Math
"" "S = a + AAA AA + AA + ... + AAAA value a, where a is a number, for example 2 + 22 + 222 + 2222 + 22222 (in this case a total of 5 the number of addition), controlled by adding a few number of keyboard
program analysis: calculated for each key is a value "" "

NUM = []
number = int (iNPUT (" enter a number: "))
length = int (input ( "enter a long term to be calculated:"))
SUM = Number
X = 0
SumOver = 0
DEF numlist (index):
Global X
Global SUM
IF X == index:
sumText = Math.pow (10, index) * Number
return sumText
the else:
numberCopy = Math.pow (10, X)
numberCopy * Number =
X +. 1 =
SUM + = numlist (X)
return SUM

for Range index in (0, + length. 1):
sumItem = numList(index)
num.append (sumItem)

for the X-in NUM:
SumOver + = the X-

Print ( "***************")
Print (NUM)
Print (SumOver)

# this to write too much water might as well get yourself confused by what simple loops have to add a recursive function pow
# beginner Python exhibitions

Guess you like

Origin www.cnblogs.com/walxt/p/11521414.html