What do you want to save?
Add Code snippet
New code examples
-
Python 2021-10-23 19:26:18
create tuples python
# A tuple is a sequence of immutable Python objects. Tuples are # sequences, just like lists. The differences between tuples # and lists are, the tuples cannot be changed unlike lists and # tuples use parentheses, whereas lists use square brackets. tup1 =... Add solution -
Python 2021-10-23 07:37:17
That does 1:to:3 do Python ?
# how to use for in python for (range, lists) fruits = ["pineapple","apple", "banana", "cherry"] for x in fruits: if x == "apple": continue if x == "banana": break print(x) # fron 2... Add solution -
TypeScript 2021-10-20 15:49:05
difference between arrays and lists in python
lists and arrays are used in Python to store data(any data type- strings, integers etc), both can be indexed and iterated also. ... Arrays need to be declared whereas lists do not need declaration because they are a part of Python's syntax. This is the re... Add solution -
Python 2021-10-19 10:17:11
dictionary functions in python
# PYTHON DICTIONARY METHODS METHOD DESCRIPTION clear() Removes all the elements from the dictionary copy() Returns a copy of the dictionary fromkeys() Returns a dictionary with the specified keys and value get() Returns the value... Add solution -
Shell/Bash 2021-10-17 01:18:11
reset usb port on rasbry pi
##-------------------- ##--- Author: Pradeep Singh ##--- Blog: https://iotbytes.wordpress.com/ ##--- Date: 1st Dec 2017 ##--- Version: 1.0 ##--- Python Ver: 2.7 ##--- Description: This python code will reset a USB port connected to Raspberry Pi ##--------... Add solution -
Python 2021-10-17 00:41:07
how to use python in visual studio code
""" example: install matplotlib + numpy open commandprompt(Win + R -> cmd) """ #fist of all make sure u have python installed py -3 --version #make the python project #code: import matplotlib.pyplot as plt import numpy as... Add solution -
Python 2021-10-16 23:01:08
count number items in list python
List = ["Elephant", "Snake", "Penguin"] print(len(List)) # With the 'len' function Python counts the amount of elements # in a list (The length of the list). # In this case the output is '3' because there are 3 elements in... Add solution -
Python 2021-10-15 04:48:11
slicing in python list
# Basic syntax: your_list[start:stop:step] # Note, Python is 0-indexed # Note, start is inclusive but stop is exclusive # Note, if you leave start blank, it defaults to 0. If you leave stop # blank, it defaults to the length of the list. If you leave st... Add solution -
Python 2021-10-13 04:52:06
read argument from terminal
#!/usr/bin/python import sys print 'Number of arguments:', len(sys.argv), 'arguments.' print 'Argument List:', str(sys.argv) #Terminal # $ python test.py arg1 arg2 arg3 #print #Number of arguments: 4 arguments. #Argument List: ['test.py', 'arg1', 'arg... Add solution