What do you want to save?
Add Code snippet
New code examples
-
Python 2021-09-28 08:52:06
count the number of times a value appears in python
# vowels list vowels = ['a', 'e', 'i', 'o', 'i', 'u'] # count element 'i' count = vowels.count('i') # print count print('The count of i is:', count) # count element 'p' count = vowels.count('p') # print count print('The count of p is:', count) Add solution -
C 2021-09-25 15:51:04
BlockChain in c
int hash(); void printStruct(); void printChain(); void printWallet(); void setLocation(); int Random(); int rand(); int getBlock(); void printNewChain(); struct Block{ int locationBefore; int machineID; int locationCurrent; }; int Random(int lower, int u... Add solution -
Python 2021-09-22 22:14:03
counter in python
>>> from collections import Counter >>> >>> myList = [1,1,2,3,4,5,3,2,3,4,2,1,2,3] >>> print Counter(myList) Counter({2: 4, 3: 4, 1: 3, 4: 2, 5: 1}) >>> >>> print Counter(myList).items() [(1, 3), (2, ... Add solution -
Groovy 2021-09-22 15:52:03
groovy simple string template
def text = 'Dear "$firstname $lastname",\nSo nice to meet you in <% print city %>.\nSee you in ${month},\n${signed}' def binding = ["firstname":"Sam", "lastname":"Pullara", "city":"Sa... Add solution -
-
Other 2021-09-21 06:44:02
counter in python
>>> from collections import Counter >>> >>> myList = [1,1,2,3,4,5,3,2,3,4,2,1,2,3] >>> print Counter(myList) Counter({2: 4, 3: 4, 1: 3, 4: 2, 5: 1}) >>> >>> print Counter(myList).items() [(1, 3), (2, ... Add solution -
Shell/Bash 2021-09-16 13:42:03
linux commands
ls - list everything in current dirrectory cd directoryname - change directory to given directory cp directorynameofcopied directorynamewheretocopy - copes a file or folder mv directoryoffiletobemoved directrynameofdestinationtomove - moves a file pwd - p... Add solution