Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- def Module(text):
- result=""
- symbol='|'
- first_appearance=text.find(symbol)
- second_appearance=text[first_appearance+1:].find(symbol)
- for index in range(len(text)):
- if index==first_appearance:
- result+="abs("
- elif index==second_appearance:
- result+=")"
- elif text[index]==',':
- result+='.'
- else:
- result+=text[index]
- return result
- print(Module('|-123,123|'))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement