How to add a condition in a list comprehension?
📁 List, Advanced Python Topics, work
I tried to do it like this, but it doesn't work
a = [int(input()) for i in range(5) if i % 10 == 0]that is, I need to add a condition so that only numbers divisible by 10 without a remainder are added to the list
To open an image using the default application on Windows:
#!/usr/bin/env pythonimport osos.startfile(r'D:\\picture.jpg') Log in to leave an answer
Blogs