**A ****python solution to the questions of Huawei Machine for cattle and guest nets**
Question 1th The length of the last word in the string

A = input (). Split ("")
print (len (a[-1))

Question 2nd count the number of characters

A = input ()
B = input ()
print (A.lower (). Count (B.lower ()))

The 3rd question is clearly random number

While True:
try:
num = int (input ()),
data = [] for
i in range (num):
data.append (int ()
) data = List (set (data))
data = sorted (data) for
i in data:
print (i)
except:
break

Question 4th string separation

def stringsplit (s): While
Len (s) >8:
print (S[0:8])
s = S[8:len (s)]
print (s+ (8-len (s)) * ' 0 ")
stringsplit (Input ())
stringsplit (input ())

Question 5th Conversion

While True:
try:
print (str (int. ()))
except: Break

6th problem Prime number factor

Def primefactor (a):
res = [] While
a>1: to
I in range (2,a+1):
if a%i = = 0:
res.append (i)
a = i NT (a/i) break return
res
a = primefactor (int (input)) for
I in a:
print (i,end= "")

7th Question approximate value

Def Myround (a):
if 10*a%10>=5: return
int (a) +1
else: return
int (a)
print (Myround float (input ()))

Question 8th Merge table record

A = input ()
d = {}
for I in range (int (a)):
b = list (int, input (). Split ("))
if b[0] not in D.key S ():
d[b[0]] = b[1]
else:
d[b[0]] = = b[1] for
key in D.keys ():
print (key, D[key))

Question 9th extract a non-duplicate integer

A = input ()
s = ' for
i in range (Len (a) -1,-1,-1):
if a[i] not in S:
s + = A[i]
print (s)

10th Inscription NUMBER Statistics

s = input ()
a = [] for
I in S:
if 0 <= ord (i) <= 127 and I:
a.append (i)
print (Len (a))

s = input ()
d = {} for
I in S:
if 0 <= ord (i) <= 127:
d[i] = 1
print (SUM (d.values ())

Question number 11th, upside down.

A = input ()
B = ' for
i in a[::-1]:
b = i
print (b)

Question 12th string reversal

A = input (). Split (')
print ('. Join (A[::-1])

13th sentence in reverse order

a = Int (input ())
B = [] for
I in Range (a):
b.append (Input ()) for
I in sorted (b):
print (i)

14th inscription string Connection longest path lookup

a = Int (input ())
B = [] for
I in Range (a):
b.append (Input ()) for
I in sorted (b):
print (i)

Question 15th 1 of the INT-type data stored in memory

Print bin (int (input ())). Count (' 1 ')

To be Continued ...