Advertisement
Spocoman

01. Absolute Values

Jan 25th, 2022
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.23 KB | None | 0 0
  1. numbers = list(map(float,input().split()))
  2.  
  3. def abs_num (x):
  4.     return abs(x)
  5.  
  6. print(list(map(abs_num, numbers)))
  7.  
  8.  
  9. Решение с ламбда:)
  10.  
  11. print(list(map(lambda x: abs(x), list(map(float,input().split())))))
  12.  
  13.  
  14.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement