Advertisement
go6odn28

1_data_types.py

Feb 15th, 2024
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.43 KB | None | 0 0
  1. def found_datatype(type_, char):
  2.     if type_ == 'int':
  3.         datatype = int(char) * 2
  4.         return datatype
  5.  
  6.     elif type_ == 'real':
  7.         datatype = float(char) * 1.5
  8.         datatype = f'{datatype:.2f}'
  9.         return datatype
  10.  
  11.     else:
  12.         datatype = f'${current_command}$'
  13.         return datatype
  14.  
  15.  
  16. current_string = input()
  17. current_command = input()
  18. print(found_datatype(current_string, current_command))
  19.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement