What do you want to save?
Add Code snippet
New code examples
-
Python 2021-11-07 12:35:18
how to get calling function in python
# Python code to demonstrate calling the #This example will help you to learn about funtion and function call #added by: vikalp chaubey # function from another function def Square(X): # computes the Square of the given number # and return to the c... Add solution -
Python 2021-11-06 10:04:21
how to pass parameters in python script
#!/usr/bin/python import sys print 'Number of arguments:', len(sys.argv), 'arguments.' print 'Argument List:', str(sys.argv) # python scriptName.py arg1 arg2 arg3 # Output: # Number of arguments: 4 arguments. # Argument List: ['test.py', 'arg1', 'arg2'... Add solution -
Python 2021-10-30 06:08:10
what is a tuple in 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-29 11:15:23
how to order a list by the length of words fro longest to shortest
# Python code to sort a list without # creating another list Use of sort() def Sorting(lst): lst.sort(key=len) return lst # Driver code lst = ["rohan", "amy", "sapna", "muhammad", &q... Add solution -
Python 2021-10-27 21:51:13
how to find palingrams python
""" Program: Python program to find anagrams in a list of strings """ from collections import Counter def get_anagrams(input_string_list, test_string): print("*******************") print("input_str... Add solution -
Shell/Bash 2021-10-27 17:06:05
filterfalse iterator
# Python code to demonstrate the working of # filterfalse() import itertools # initializing list li = [2, 4, 5, 7, 8] # using filterfalse() to print false values print ("The values that ... Add solution -
Python 2021-10-25 01:18:05
empty clear delete a list
# Python program to clear a list # using clear() method # Creating list GEEK = [6, 0, 4, 1] print('GEEK before clear:', GEEK) # Clearing list GEEK.clear() print('GEEK after clear:', GEEK) Add solution -
Python 2021-10-24 17:36:12
python how to count all elements in a list
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-24 02:51:06
do intersection between list python
# Python program to illustrate the intersection # of two lists in most simple way def intersection(lst1, lst2): lst3 = [value for value in lst1 if value in lst2] return lst3 # Driver Code lst1 =... Add solution