The number of 6-digit even numbers that can be made from the number 214635 are:

Image
The number of 6-digit even numbers that can be made from the number 214635 are:  a) 18 b) 72  c) 120 d) 360 Answer:  D from the question we can see we have to form 6 digit number(no repetition) so, let us six blanks as show below : _ _ _ _ _ _  if the number has to be even it has to be end with even number. 214635   from the above digits even numbers are 2,4,6 so, the units digit is 2 or 4 or 6 so, the no.of.ways is 3 remaining 5 digits can be filled with 5! ways  so, the answer is 5!x3 ways                             = 360 ways  remaini

Python dictonaries

 


Good day !!
         Hello guys , have a recap at my previous blog . I have explained about tuples. Previous

Context of blogs
DICTIONARIES 
Operations 
  • Accessing 
  • Updating 
  • Deleting 
  • Length 




          Today we are  going to learn about dictionaries in python . As we have got many data types(lists , tuples  ... ) why still we are using dictionaries , right ?   
You will have a clear idea at the end of this blog . Let's start now !! 

Let me explain the disadvantages of list First . In list we cannot access the two different variables at a time . Warch this video for explanation. 

Dictionaries 
     Dictionaries are very unique to other data types . It should be embedded in curly parenthesis "{}". It has two sections one is key and value pair . Dictionaries works  on key-value pair . 
Syntax 
dict = {k1 : v1 , k2 : v2 , ....... }
Keys     =  k1,k2...........
Values = v1,v2........
Watch this for clear understanding 


This is way to declare the dictionaries . 
We will be going to operations in dictionaries. 
Operations 
Accessing the element in dictionary .
Syntax:
dict[key] # we are accessing the value 


Second operation is updating a dictionary 
Updating 
We can update the value in pair . 
Syntax 
dict[k1] = Vn #Vn is new value .
Watch this video 


Deleting the key - value pair 
By using del function we can delete the element in dictionary 
Checking the length of dictionary 
By using len function we can check the length of the dictionary. 
Watch this video for clear explanation 


Last thing , don't forgot look at this (precaution)
Yeah , we should not enter the same key in one dictionary. 
Look at this for avoiding the confusion . 


Thank you for reading this blog . Hope you liked my writings. 

Comments

Popular posts from this blog

Python tupes

If the sum of 4 times a number A and three times a number B is equal to the sum of number B and seven times the number A, then what is the value of A:B? | CTS previous Aptitude question