Issue
I have a list contains around 200 numbers. I need a list fraction of them. I mean I have a=[111,23,25,12,61]
I want b=[1/111,1/23,1/25,1/12,1/61]
How can i do that?
Solution
With a list comprehension:
[1.0/x for x in a]
Answered By - JulienD
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.