Print The Positive Numbers In A List | Python Example
HTML-код
- Опубликовано: 5 сен 2024
- How to print the positive numbers in a list using Python. Source code: github.com/por.... Check out www.portfolioc... to build a portfolio that will impress employers!
Hey! great video.
Here is another way to do this that is also only one line using list comprehension
print(', '.join([str(p) for p in [-1, 2, 42, -10, 0, 37, 1] if p > 0]))