Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def type_int(symbol):
- num = int(symbol)
- return num * 2
- def type_real(symbol):
- num = int(symbol)
- return num * 1.5
- def type_string(symbol):
- greeting = '$' + symbol + '$'
- return greeting
- type_line = input()
- new_symbol = input()
- if type_line == "int":
- print(type_int(new_symbol))
- if type_line == "real":
- print(f"{type_real(new_symbol):.2f}")
- if type_line == "string":
- print(type_string(new_symbol))
Advertisement
Add Comment
Please, Sign In to add comment