I have program than finds the minimum temperature of every month, but i can't find a way for it to find the minimum temperature that is higher than 0, i can't just use min() cos if the month has temperature that is lower than 0 it is also counted.
gdr969
0
Newbie Poster
Recommended Answers
Jump to PostThis should work
value = min(x for x in temperature_sequence if x > 0)
Note: this raises ValueError if all temperatures are below 0.
All 2 Replies
Gribouillis
1,391
Programming Explorer
Team Colleague
gdr969
commented:
helped with resolving problem
+0
gdr969
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.