Send
Close Add comments:
(status displays here)
Got it! This site "robinsnyder.com" uses cookies. You consent to this by clicking on "Got it!" or by continuing to use this website. Note: This appears on each machine/browser from which this site is accessed.
Python list comprehensions
1. Python list comprehensions
Create a list of the first 10 even numbers starting with 0 (zero) and then print out the list as a string all on one line.
2. Even number list
Here is the Python code [#1]
Here is the output of the Python code.
Here is the Python code [#2]
Here is the output of the Python code.
3. Concatenation
Whenever converting lists into strings, do not use the concatenation operator "+" (even though it works).
Instead, use the join method of the string data type (class).
4. End of page