At 18:02 although get( ) method takes one argument, the default value for a key not found is None. For example if your argument is a Key, that does not exist already in the dictionary, it will return a None. But separated by a comma you can chose to return any default value. This allows the user to make a count or histogram / frequency chart as you would call it.
@irenekinyanjui69813 жыл бұрын
thanks for your video. python has become easy to understand after watching your video.
@entertainmentviaindia54184 жыл бұрын
At 24:42 correct syntax would be d.setdefault("perc",90)
@chandruas26423 жыл бұрын
Superb teaching
@hemchandmovva44604 жыл бұрын
U r very good sir👌👌👌
@naveenhagaragi84604 жыл бұрын
At 19:00 for fromkeys() method, value argument is optional. if you don't give any value argument, it will print 'None' in place of values for all keys Ex: x = ('key1', 'key2', 'key3') d1 = d.fromkeys(x) print(d1) output: ['key1': None, 'key2': None, 'key3': None]
@devduttsinh47044 жыл бұрын
Sir ad aayi apke video me 👏👏🤘
@sukanyaghosh243 жыл бұрын
Thanku for teaching soo perfectly sir, please keep making videos of more of topics of CS..
@gshanth56452 жыл бұрын
tq brother for sharing valuable content
@varshaamanikandan38294 жыл бұрын
Sir your teaching nice
@devashishghosh7497 Жыл бұрын
Update is used to add one or more items in the existing dictionary
@Adithya8382 жыл бұрын
Thank you very much sir🙏🙏🙏🙏
@vinobharath79634 жыл бұрын
Super ji
@Raja-tt4ll2 жыл бұрын
Nice
@hemchandmovva44604 жыл бұрын
Thank u so much sir
@markkennedy9767 Жыл бұрын
Can you explain why a.sort() returns None for a list a, but a.values() doesn't return None if a is a dictionary. Both dictionaries and lists are mutable (and if mutable, are modified in place, right?). So why is a method such as sort on a list void whereas a method on a dictionary not void (and can be assigned to another variable, printed etc). Any help would be great because right now I have no clear appreciation between mutability, modifying in place and returning None . Thanks
@likithaanga70002 жыл бұрын
anna tell me eexample of items
@reddy_29042 жыл бұрын
Is Methods and Functions are same in python dictionary.. Or different? If different then what are the functions of dictionary? Sir please Rply
@lshankar835 жыл бұрын
can you tell what is wring in my following code : want to access certain key values from a json file (in dictionary format) and store it to a variable. if rain: key_values=[[data['state'] for data in response.json['records']['data'] if 'state' in data and str(data ['rainyDate']).lower()== str(rain).lower()]
@sundeepsaradhi5 жыл бұрын
Hi My be improper closing of square brackets
@lshankar835 жыл бұрын
@@sundeepsaradhi but I am not getting any error.. so brackets are fine..
@immrinzler78144 жыл бұрын
Hello sir , in dictionary how to get user input to access value by typing keyword please? Can u help me out for eg : when i type 1(key) it should show value stored at it in o/p sreeen , not to type in program window also key and value is user input
@utkarshrawat57934 жыл бұрын
x = DictionaryName.get("KeyName") print(x)
@utkarshrawat57934 жыл бұрын
x = DictionaryName["KeyName"] print(x)
@JavaAidTutorials5 жыл бұрын
Nice..
@prathapasalistener99974 жыл бұрын
super brother.
@dancerprakhar10525 жыл бұрын
Sr i want full course of python plz help me sr my humble request
@vudariprabhakarmudiraj9754 жыл бұрын
Thankyuo sir wonderful explaination d={'name': 'nirvaan', 'rno': 1, 'branch': 'doct'} d.setdefault('rno':3) print(d) iam getting error below please explain me File "", line 1 d.setdefault('rno':3) ^ SyntaxError: invalid syntax
@SELVARAJCSE4 жыл бұрын
Prabhakar mudiraj d.setdefault(‘rno’,3) Its ,(comma) in between the key and value
@hydrabeast49555 жыл бұрын
Sir according to you which is better for future CSE OR ECE. PLEASE HELP
@sundeepsaradhi5 жыл бұрын
Hi Every branch will have it's own identity and importance. Both the branches will be having bright future.
@janakiyeluripati63684 жыл бұрын
sir can you explain how to find out the word frequency in a string using for loops
@saatwiiksrivastava55494 жыл бұрын
k=0 for i in string_name: if i=="word": k+=1 print(k) this should work i think
@anithaanitha54145 жыл бұрын
Sir pls upload python tutorials
@divyag78544 жыл бұрын
In dict can call keys But elements or values can't call tat?
@harshilmistry78614 жыл бұрын
What a lame method, Sir you could have shared your screen and teach with live example.