Loading ...
SeekhoCoding
Python Syllabus Game Python Projects

Chapter 5 : Python Data Structures (Practice Sets)

हमने इस Web Page पर Python Language के बहुत ही महात्वपूर्ण Topic Data Structure से संबंधित Problems Add की है | data को store करना , access करना , Delete करना Data के साथ आदि काम करने के तरीके को Data Structure कहा जाता है | इस Web Page को add करने का उद्देश्य आपको Python Data Structure Topics का अभ्यास कराने और आपकी Coding Skills को बेहतर बनाना है | Python language हो या C , C++ , java Script जैसी कोई और language सभी languages मे data Structure की समझ होना बहुत जरूरी है | इस Web Page पर दि गई Problems को solve करने से पहले Python Data Structure को जरूर पढ़े ताकि नीचे दि गई Problems को Solve करने मे आपको किसी Problem का समना न करना पडे |

Problem 1 :

Schools मे Students Exam के Time अपने Roll Number के अनुसार Room मे Exam के लिए Present होते है |
नीचे दिए गए code editor मे Dictionary Data Structure से एक Python Code लिखे जो ,

  1. Student से Input मे Roll Number ले |
  2. लिए गए Roll Number के Base पर Student का Room Number और Seat Number Show करे |
  3. NOTE : Python Code मे पहले से Roll No Wise Room And Seat No. information Store हो |

Python Loading...

Code Explanation

  1. std_seat = { } = > std_seat एक variable है जिसमे Students की Informations Stored है |
  2. seat = input("") = > seat variable input मे Student का roll Number Store करता है |
  3. if seat in std_seat : = > seat variable मे stored roll number std_seat variable मे मिल जाने पर ये if statement True होती है |
  4. print(f"{std_seat[seat]}") = > ये print() function seat variable मे stored roll Number के according std_seat variable से information show करता है |
  5. else: = > if statement के false होने के बाद ये else block चलता है |
  6. print("") = > ये print() else के true होने के बाद screen पर Roll Not Found Please Check Your Roll Number . message को show करता है |

Problem 2 :

Company Manager से Company Information पता करने की बजाए कोई व्यक्ति किसी Company की official website पर जाकर Company से related information पता कर सकता है | एक Program लिखे जो ,

  1. input मे एक Car का name ले |
  2. उस Car Name को Available Cars मे check करे |
  3. Car Name Available Cars name मे मिल जाने पर उस car से related Information show हो |
  4. Car Name Available Cars name मे न मिलने पर message show हो "Now This car Not Available"
  5. NOTE : Program मे कुछ cars से related कुछ Information पहले Dictionary format मे stored हो |

Python Loading...

Code Explanation

  1. car_info = { = > car_info एक variable है जिसमे Dictionary के format मे cars से related information store की गई है |
  2. car_name = input("") = > car_name एक variable है जो input मे car name store करता है |
  3. if car_name in car_info: = > car_name variable मे stored value car_info variable मे मिल जाने पर ये if statement True होती है |
  4. print(f"{car_info[car_name]}") = > ये print() function if statement के true होने के बाद car name के according car_info variable मे stored information show करता है |
  5. print("Now This Car Not Available") = > ये print function else के true होने के बाद screen पर Now This Car Not Available message को show करता है |

Problem 3 :

School Principal किसी student के id card से roll number ले करके School की official website पर enter करके Student से Related सारी information पता कर सकता है | एक Program लिखे जो ,

  1. input मे एक roll Number ले |
  2. ROll Number को stored Roll Numbers मे check करे |
  3. ROll Number के stored Roll Numbers मे मिल जाने पर उस Roll Number से related Information show हो |
  4. ROll Number के stored Roll Number मे न मिलने पर message show हो "Wrong Roll Number"
  5. NOTE : Program मे कुछ ROll Number से related कुछ Information पहले Dictionary format मे stored हो |

Python Loading...

Code Explanation

  1. std_info = { = > std_info ए क Dictionary Type variable है जि स मे Roll Number से Related information stored है |
  2. std_roll = input("") = > std_roll variable user से Input मे value store करता है |
  3. if std_roll in std_info: = > ये if statement std_roll variable मे stored roll std_info variable मे stored data मे मिल जाने पर True होती है |

Problem 4 :

Internet के Time मे व्यक्ति कठिन words के मतलब Online पता कर लेते है जिससे ठीक answer , Short Time जैसे लाभ मिलते है |
नीचे दिए गए code editor मे Dictionary Data Structure से एक Program create करो जो ,

  1. input मे कोई एक word ले |
  2. Word को stored data मे check करे |
  3. Word के stored data मे मिल जाने पर उस word का मतलब show हो |
  4. word के stored data मे न मिलने पर "THis Word Not Stored"

Python Loading...

Code Explanation

  1. meaning = { = > meaning variable मे Dictionary के format मे english words के hindi meaning store किए गए है |
  2. word = = > word एक variable है वो user के word को store करता है |
  3. if word in meaning: = > user के word को meaning variable मे मिल जाने पर ये if statement True होती है |
  4. else: = > user के word के meaning variable मे न मिलने पर ये else True होती है |

Problem 5 :

नीचे दिए गए code editor मे एक contack Book का Program लिखे जिसके उपयोग से कोई भी Person जिस किसी का mobile number पता करना हो वो केवल उस person का name enter करे और उस person को उस person का Mobile number मिल जाए |

Python Loading...

Code Explanation

  1. mobile = { = > mobile एक variable है जिसमे name के according mobile numbers stored है |
  2. if name in mobile: = > name variable मे stored value mobile variable मे मिल जाने पर ये if statement True होती है |
  3. print(f"{mobile[name]}") = > ये print() if statement के True होने पर mobile variable से name variable मे stored value के according data show करता है |

Problem 6 :

नीचे दिए गए code editor मे एक Program दिया गया जो किसी list मे stored सभी items के prices से total bill calculate करता है , लेकिन Program मे एक mistake है जिसके कारण Program को run के बाद error आ रहा है आपको उस error को remove करके Program को error free करना है और Total Bill calculate करना है |

Python Loading...

Code Explanation

  1. prices = [ ] = > prices variable मे list के type मे items के prices store किए गए है |
  2. total = 0 = > total variable मे 0 value store की गई है |
  3. for price in prices: = > ये for loop prices variable से values को price variable मे store करता है |
  4. total += price = > price variable मे stored value को total variable मे add की गई है |
  5. print("" , total) = > ये print() function total variable मे stored value को show करता है |

Problem 7 :

Shop वाला customer को केवल वही समान देता है जिस समान को customer purchase करता है | purchased समान के अलावा saller कोई extra समान नही देता है |
नीचे दिए गए Program मे एक Tuple मे Student Roll Number , Name , Marks से related Information Stored है आपको Program को पूरा कर Student का Name And Marks Print करने है |

Python Loading...

Code Explanation

  1. std = (1, "Rahul", 800) = > Tuple के format मे std variable मे student से related information stored है |
  2. print("Employee Name:", std[1]) = > ये print() function std variable के index number 1 पर stored value को show करता है |
  3. print("Employee Salary:", std[2]) = > ये print() function std variable के index number 2 पर stored value को show करता है |

Problem 8 :

101 , 102 , 101 , 105
उपर एक website के Visitors की IDs दि गई आपको नीचे दिए गए code editor मे एक program लिखना है जो उपर दि गई IDs मे से सबसे Unique Ids बताए | ताकि पता किया जा सके कि कौन - से Visitors website पर अधिक Time spend करते है |

Python Loading...

Code Explanation

  1. visitors = [ ] = > List के format मे visitors variable मे website visitors की Ids store की गई है |
  2. unique_visitors = set(visitors) = > unique_visitors variable मे unique visitors IDs store की गई है |
  3. print("Unique Visitors =", unique_visitors) = > ये Print() unique_visitors की Total Lenght show करता है |

Problem 9 :

class_6th = Deepak , Anshul , Jeetu , Umesh class7th = Sachin , Ashish , Anshul , Deepak
उपर दो Classes के students के names दिए गए आपको नीचे दिए गए code editor मे एक program लिखना है जो उपर दिए गए names मे से Common Names को show करे |

Python Loading...

Code Explanation

  1. class_6th , class7th = > class_6th , class7th दो variables मे Set के format मे students के names store किए गए है |
  2. common = class_6th & class7th = > common variable मे class_6th और class7th के Names store किए गए है |
  3. print(" ", common) = > ये Print() common variable मे stored data को show करता है |

Problem 10 :

Class मे जिस student के Marks सभी students से अधिक होते है उस student को class का Topper कहा जाता है और Prise दिए जाते है |
नीचे एक class के सभी students के marks दिए गए है एक Python code लिखे जो नीचे दिए गए marks मे से सबसे अधिक marks को Show करे |
marks = (50, 72, 40, 75, 74, 90, 80)

Python Loading...

Code Explanation

  1. marks = > marks variables मे students के names store किए गए है |
  2. print("Maximum Temperature =", max(marks)) = > ये print() function screen पर marks variable मे stored सभी marks मे से Highest Marks को show करता है |

You have completed This Chapter ! 🎉

Now you can choose any one of the following options to test your knowledge :

💻

Code Practice

Solve practical exercises .

Practice Now
🏆

Knowledge Test

Answer the questions of the chapter .

Start Test
📘

Next Chapter

Continue your Python journey by reading the next chapter.

Next Chapter
🆘

Help Center

Users and we all help you together .

Peer Learning
Expert Advice
Live Chat
Fast Solutions