Advertisement
Natalia__krkrkr

Умножение

Aug 8th, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.84 KB | None | 0 0
  1. num = input("Введите число два числа до 100000: ")
  2. m_all_num2 = []
  3. m_num1 = []
  4. m_num2 = []
  5. x = num.split(" ")
  6. z = abs(int(x[0]))
  7. y = abs(int(x[1]))
  8. for i in list(str(y)):
  9.     m_num1.append(int(i))
  10. for i in range(5):
  11.     if i == 0:
  12.         i = 10000
  13.         number_1 = (z//i) % 10
  14.     else:
  15.         i = 10000 / (10**i)
  16.         number_2 = int((z // i) % 10)
  17.         m_all_num2.append(number_2)
  18.         for num2 in m_all_num2:
  19.             if num2 > 0:
  20.                 m_num2.append(number_2)
  21.                 break
  22. composition_1 = 1
  23. composition_2 = 1
  24. comp_1 = 1
  25. comp_2 = 1
  26. for e in range(len(m_num1)):
  27.     comp_1 = composition_1*m_num1[e]
  28.     composition_1 = comp_1
  29. for f in range(len(m_num2)):
  30.     comp_2 = composition_2*m_num2[f]
  31.     composition_2 = comp_2
  32. composition_end = comp_1*comp_2
  33. print(composition_end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement