Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- registro = '....................100 .......513.25 ..........'
- # Sin slice()
- costo = int(registro[20:32]) * float(registro[40:48])
- print(costo)
- # Con slice()
- cantidad = slice(20, 32)
- valor = slice(40, 48)
- costo = int(registro[cantidad]) * float(registro[valor])
- print(costo)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement