Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Create a list of multiples of 3 from 0 to 20.

In [1]: a = [i for i in range(20) if i % 3 ==0]                                                   

In [2]: a                                                                                         
Out[2]: [0, 3, 6, 9, 12, 15, 18]
Comment

PREVIOUS NEXT
Code Example
Python :: NumPy bitwise_or Code When inputs are arrays 
Python :: NumPy invert Code When the input is a number 
Python :: NumPy right_shift Code When inputs and bit shift are an arrays 
Python :: Convertion of number into binary using NumPy binary_repr 
Python :: django admin auto update date field 
Python :: django check for empty onetoone exists 
Python :: pandas aggregate rename column 
Python :: # find all text files in directory or any type of files in directory 
Python :: geopandas cmap change options 
Python :: penggunaan fromkeys di python 
Python :: Remove Brackets from List Using join method with loop 
Python :: python call c function 
Python :: add ing to the end of a string or add ly if the string ends with ing python 
Python :: pygame getting your charecter to jump 
Python :: list average python recursion 
Python :: ternary operator in list comprehension python 
Python :: empty list 
Python :: django assign authenticated user to foreign user 
Python :: Not getting values from Select Fields with jQuery 
Python :: Python 3 (python 3.7.3) sample 
Python :: python complement operator 
Python :: ring Using Lists during definition 
Python :: can you make a class in a class python 
Python :: notebook prevent cell output 
Python :: get feature names from one hot encoder 
Python :: python list of datetimes as type string 
Python :: Matplotlib-Object oriented interface 
Python :: tens place in digit 
Python :: alterning format when reading from a text file 
Python :: pattern program in python A aB bCc DdEe 
ADD CONTENT
Topic
Content
Source link
Name
3+9 =