TOPIC

Python 3 Runtime error =Que esta errado ?

César Javier Fois asked 11 months ago

prop = cpf = ''
s = input()
s1 = input()
a = b = c = d = ''
for i in s:
    if i.isdigit() or i == '.':
        cpf += i

for e in s1:
    if e.isdigit() or e == '.':
        prop += e

if '.' in s:
    a,b = cpf[11:].split('.')
    a = a + '.' + b[:2]
else:
    a = cpf[11:]
if '.' in s1:
    c, d = prop.split('.')
    c = c + '.' + d[:2]
else:
    c = prop

print('cpf %s' % cpf[:11])
print('%.2f' % (float(a) + float(c)))

This topic has not been answered yet. Be the first!

Remember not post solutions. Your post may be reviewed by our moderators.