What do you want to save?
Add Code snippet
New code examples
-
Other 2021-09-15 11:42:02
comment multiple lines in python shortcut
#There is no way to comment multiple lines in Python. #You just keep using "#" symbol to comment each line out. ''' Technically you could also use triple single quotation marks like so, but this formatting does not count as "true" sou... Add solution -
Python 2021-09-12 00:29:02
pyhton permutations
# A Python program to print all permutations using library function from itertools import permutations perm = permutations([1, 2, 3]) for i in list(perm): print (i) # (1, 2, 3) # (1, 3, 2) # (2, 1, 3) # (2, 3, 1) # (3, 1, 2) # (3, 2, 1) Add solution -
Other 2021-09-08 09:24:01
Packing- when we do not know how many arguments to use
# A Python program to demonstrate use # of packing # This function uses packing to sum # unknown number of arguments def mySum(*args): return sum(args) # Driver code print(mySum(1, 2, 3, 4, 5)) print(mySum(10, 20)) Add solution -
Other 2021-09-06 10:19:02
how to use djoser signals
what are django signals? The Django Signals is a strategy to allow decoupled applications to get notified when certain events occur There are two key elements in the signals machinary: the senders and the receivers. As the name suggests, the sender is t... Add solution