This chapter feels really good?️
Read More Hello everyone,
To all the python programmers out there,
I have brought few tricks for you to apply in your codes
Trick 1: reversing a string
my_string = "SONAKSHI"
rev_string = my_string[::-1]
print(rev_string)
OUTPUT: IHSKANOS
Trick 2: Find occurrence of all the elements in the list.
from collections import Counter
my_list = [1,2,3,1,4,1,5,5]
print(Counter(my_list))
OUTPUT: Counter({1: 3, 5: 2, 2: 1, 3: 1, 4: 1})
Trick3: We all know elements of list are mutable(changeable), right?
But do you know python has provided us with a way to make it immutable.
using frozenset()
my_list = [1,2,3,4,5]
my_list = frozenset(my_list)
my_list[3]=7
print(my_list)
OUTPUT: Traceback (most recent call last):
File "
Teal blue
Read MoreWriter... ❤ #????? #?????? #?????? #???????? #???? #????????? #????? #????????? #????? #???? #???????? #????????#??????? #?????? #???????? #???? #creatorshala #blogger #intern #passion
Read MoreA healthy breakfast ensures a healthy kick start to the day??
Read MoreThrowback to fashion show days ?? #cshala #creator #fashion #traditional
Read MoreGlittery soul ✨?
Read MoreNARS highlighter ? #makeup #blogging #Nars #creatorshala
Read MoreYaad piiya ki aane lagi ?? #creatorshala @creatorshala #blogger #bellydancer #bellydancevideo
Read MoreIn my mind, In my head. This is where we all came from.
Read More