keys Method in Python Dictionary|Dictionary in Python|Fetching All Keys From Dictionary.

  Рет қаралды 1,995

Code-yug

Code-yug

Күн бұрын

keys Method in Python Dictionary|Dictionary in Python|Fetching All Keys From Dictionary.
This video is part of python tutorial for beginners in hindi.In this video,i have explained about keys Method in Python Dictionary.This method is used to fetch all keys from a given dictionary.
you will learn:-
1) keys Method in Python Dictionary
2) Fetching All Keys From Dictionary
source code :-
About Python Tutorial:- python for beginners-Go from Zero to Hero in python.This tutorial includes python programming videos from basics to advanced
master in python:- bit.ly/392NTMq
More tutorials:-
file handling in python:- bit.ly/3nBEW5c
string in python:- bit.ly/3lnygFc
About codeyug :-
Codeyug provides tutorials for building your programming skills.Here,you will learn various programming languages,computer science,web development with free of cost.
learn from codeyug:- bit.ly/3h3Bv0c
SHARE | SUBSCRIBE | LIKE
-- - - - - - - - - - - - - - - - - -Thanks for watching this video - - - - - - - - - - - - - - - - - -- -
Our social links:-
you tube:- bit.ly/3h3Bv0c
instagram:- bit.ly/3mlspQu
gmail :- shantanukejkar@gmail.com
creator:-
$ -shantanu kejkar -$
About me:- shorturl.at/nCOU9
#python #python3 #programming #codeyug #comments #tutorial #beginners #coding

Пікірлер: 3
@prathmesh_kawthankar
@prathmesh_kawthankar Жыл бұрын
Sir voh "f "kyu use kiya hai apne . 3:46 video time point
@Codeyug
@Codeyug Жыл бұрын
watch this video:- kzbin.info/www/bejne/o3bScqF3q9mKhck
@KaranSinghD-yj9ep
@KaranSinghD-yj9ep 2 жыл бұрын
#view object in python """ 1. view of key-value pairs (using item() method) 2. view of key : (using keys() method) 3. view of item : (using values() method) """ #keys() method. """python keys() method is used to fetch all the keys from the dict. syntax: dict.keys() #no parameter. """ rank = {"karan":1,"raj":2,"ashish":3,"manish":4,"chandan":"fail"} keys_view = rank.keys() print(keys_view) ranks = {"karan":1,"raj":2,"ashish":3,"manish":4,"chandan":"fail"} keys_view = list(ranks.keys()) print(keys_view) for i in keys_view : print(f"{i} got {ranks[i]} rank in 12th") fees = {"karan":1200 ,"raj":1400,"ashish":1450} actual_fees= 1500 keys_view=list(fees.keys()) print(keys_view) for i in keys_view : print(f"{i} got discount of {(actual_fees- fees[i])/actual_fees*100} percentage") #values() method #It us used to know the value of the key. karan = {"maths":50,"social":64,"english":60,"Hindi":40,"science":76} print(karan.keys()) print(karan.values()) raj = {"maths":76,"social":89,"english":90,"Hindi":78,"science":90} marks = list(raj.values()) total = sum(marks) print(marks) print(total) #items() method in dictionary """ In python dictionary item() method js used to return the list with all keys with values. syntax: dict_name.items() """ shopping = {"phone":10000,"laptop":45000,"earphone":1000,"speaker":900} print(shopping) shopping = shopping.items() print(shopping) #return tuple in each element within a list. list_form = list(shopping) print(list_form) employee = {"mani":50000,"Sundar":40000,"gopal":70000} employee_list= employee.items() for employees in employee_list: print(f"The employee {employees[0]} earn {employees[1]} as per income tax department") #setdefault() method: """ syntax : dict_name.setdefault("key","value") #key is mandatory and value is optional """ chr1= {"a":1,"b":2,"c":3,"d":4,"e":5} print(chr1) chr2= chr1.setdefault("godd",8) #add this value by default. print(chr1) print(chr2)
How to Iterate Through a Dictionary in Python
6:01
Real Python
Рет қаралды 67 М.
Sigma Kid Mistake #funny #sigma
00:17
CRAZY GREAPA
Рет қаралды 30 МЛН
Сестра обхитрила!
00:17
Victoria Portfolio
Рет қаралды 958 М.
Support each other🤝
00:31
ISSEI / いっせい
Рет қаралды 81 МЛН
Python dictionaries are easy 📙
8:06
Bro Code
Рет қаралды 293 М.
AsyncIO, await, and async - Concurrency in Python
9:12
Socratica
Рет қаралды 122 М.
Python Tutorial: if __name__ == '__main__'
8:43
Corey Schafer
Рет қаралды 2 МЛН
Python Tutorial: Extracting values from dictionaries with for loops
8:02
10 Important Python Concepts In 20 Minutes
18:49
Indently
Рет қаралды 498 М.
Please Master These 10 Python Functions…
22:17
Tech With Tim
Рет қаралды 274 М.
DICTIONARIES (CREATION AND ACCESSING) - PYTHON PROGRAMMING
20:54
Sundeep Saradhi Kanthety
Рет қаралды 77 М.
Sigma Kid Mistake #funny #sigma
00:17
CRAZY GREAPA
Рет қаралды 30 МЛН