What do you want to save?
Add Code snippet
New code examples
-
Python 2021-10-09 16:07:03
python draw polygon
# credit to the Stack Overflow user in the source link import matplotlib.pyplot as plt coord = [[1,1], [2,1], [2,2], [1,2], [0.5,1.5]] coord.append(coord[0]) # repeat the first point to create a 'closed loop' xs, ys = zip(*coord) # create lists of x an... Add solution -
Python 2021-09-23 02:29:05
creating list of numbers in python
# Python3 Program to Create list # with integers within given range def createList(r1, r2): return list(range(r1, r2+1)) # Driver Code r1, r2 = -1, 1 print(createList(r1... Add solution -
Python 2021-09-21 22:13:05
python convert list of lists to array
# Basic syntax: numpy.array(list_of_lists) # Example usage: import numpy as np list_of_lists = [[1, 2, 3], [4, 5, 6]] # Create list of lists your_array = np.array(list_of_lists) # Convert list of lists to array your_array --> array([[1, 2, 3], ... Add solution -
Python 2021-09-15 17:38:02
python ists
my_list = ["banana", "cherry", "apple"] # len() : get the number of elements in a list print("Length:", len(my_list)) # append() : adds an element to the end of the list my_list.append("orange") # inser... Add solution -
Shell/Bash 2021-08-26 11:00:03
how to use virtualenvwrapper
# install Virtual Environment alternative to virtualenv pip install virtualenvwrapper # modify your .profile file # find out where virtualenvwrapper.sh file is by issuing which command # source it as shown below source /usr/local/bin/virtualenvwrapper.sh... Add solution