Quick Python Tip: List Comprehension Magic
Ever seen this and wondered what it does?
squares = [x**2 for x in range(10)]
print(squares)
Challenge for You:
Try writing a one-liner that gets only even numbers from 0 to 20 using list comprehension.
#PythonTips #CodeDaily #LearnToCode #StudentLife #Projectwithsourcecodes
😄
Please open Telegram to view this post
VIEW IN TELEGRAM