Chapter 8 : Python Data Types (Practice Sets)
इस Web Page पर Python Data Types से संबंधित Practice sets Add किए गए है | Data के Type को Data Type कहा जाता है , इसलिए Python Language मे Projects Create करने के लिए Data Types बहुत HelpFul होते है | इस Web Page पर Data Types से संबंधित Practice Sets add करने का Purpose आपको Python Data Types के छोटे - से - छोटे Concept को समझाना है , इसलिए बिना किसी की Help के अभी दि गई Problems को Solve करे |
Problem 1 :
किसी अनजान व्यक्ति के घर पर आने पर पहले उससे उसका Name पूछते जाता है और फिर उस व्यक्ति का
welcome किया जाता है |
नीचे दिए गए code editor मे एक Program लिखे जो ,
- User से User का Name ले और Name variable मे store करे |
- Welcome To You <Name> Print करो |
Code Explanation
- Name = > Name एक variable है जो input मे user का Name store करता है |
- print() = > print() Function screen पर Name variable मे stored value को show करता है |
Problem 2 :
student Percentage मे result पता करने के लिए Total marks को Numbers of subject से devide करके
Marks Average निकालता है |
नीचे दिए गए code editor मे एक Program लिखे जिसमे ,
- Marks List form मे store हो |
- Marks को calculate करके Average value निकाले |
Code Explanation
- marks = [50, 60, 70, 80, 90] = > marks एक variable है जिसमे student के marks List के type मे stored है |
- average = sum(marks) / len(marks) = > average ए क variable है जि स मे marks की average value stored है |
- sum(marks) / len(marks) = > sum function stored सही marks का sum calculate करता है और len() function Numbers of Marks calculate करता है |
- print(average) = > ये print() average variable को print करता है |
Problem 3 :
College Result List मे Studens के Results student के Roll Number के According show होते है |
नीचे दिए गए code editor मे Tuple के उपयोग से एक Program लिखे जिसमे ,
- Tuple के Type मे कुछ names stored हो |
- Tuple मे index Number 2 पर stored value को show करे |
Code Explanation
- names = ("Kamal" , "Deepak" , "Gopal") = > names एक variable है जिसमे student के names Tuple के type मे stored है |
- print(names[2]) = > ये print() screen पर names variable के index number 2 पर stored value को show करता है |
Problem 4 :
नीचे दिए गए code editor मे एक Program दिया गया है जो ,
- Input मे User से Age लेता है |
- User Age 18 से कम या equal होने पर "True" message show करता है |
- User Age 18 से अधिक होने पर "False" message show करता है |
Code Explanation
- age = int(input("Enter Your Age : ")) = > age एक variable जो input मे User user की age store करता है |
- Result = age <= 18 = > दि गई condition के according Result result store करता है |
Problem 5 :
School मे students , Teacher Student से पूछते है की इस Word की Total lenght बताए |
नीचे दिए गए code editor मे एक Program लिखे जो ,
- Input मे Words ले |
- Words मे उपयोग किए गए Total Numbers , letters etc. count करे |
- Total lenght show करे |
Code Explanation
- Words = input("Enter A Words : ") = > Words एक variable जो input मे User Words store करता है |
- lenght = len(sentence) = > lenght variable Words variable मे stored variables की Total lenght को store करता है |
- print(lenght) = > ये print() lenght variable को show करता है |
Problem 6 :
नीचे दिए गए code editor मे एक Python Code दिया गया है जो ,
- user से Input मे कोई एक Number लेता है |
- Number एक Even Number होने पर "True" show करता है |
- Number एक Even Number न होने पर "False" show करे |
लेकिन इस Code मे mistake है जिसके कारण Error आ रही है आपको Program को error free करना है |
Code Explanation
- num = int(input("Enter Your Number : ")) = > num एक variable है जो input मे user कोई number value store करता है |
- result = num % 2 == 0 = > num variable मे stored number को 2 से devide करने के बाद बचा हुआ reminer 0 के बराबर होने पर ये condition true होते है |
- print(result) = > ये print() result variable को show करता है |
Problem 7 :
Company मे jobs पाने से पहले User से उसका experience पूछा जाता है |
नीचे दिए code editor मे एक code दिया गया है जो किसी variable मे stored value का type check
करता
है और variable के type को show करता है लेकिन Code मे error है आपको code से error को
remove करना है और variable के type को पता करना है |
Code Explanation
- name = "Kapil" = > name एक variable है जिसमे एक Name stored है |
- print(type(name)) = > ये print() name variable के type को show करता है |
Problem 8 :
नीचे दिए गए code editor मे एक Python Code लिखे जो ,
दो classes के common Students names को show करे |
Code Explanation
- class6 , class7 = > दोनों variables मे Studens के Names store किए गए है |
- common_names = class6 & class7 = > common_names common names को store करता है |
- print(common_names = > ये print() function common_names variable को Show करता है |
Problem 9 :
Studens अपने Tests को Teacher के Bench पर एक Tests के नीचे एक - एक Test के नीचे एक और
Teacher
last वाले Test से Test checking start करता है |
नीचे दिए गए code editor मे एक Python Code दिया गया है जिसमे ,
- एक List मे Students Marks stored है |
- List मे stored Marks को show किया गया है |
आपको Marks को Reverse करना है |
Code Explanation
- numbers = [10, 20, 30, 40, 50] = > numbers एक variables है जिसमे Studens के Test marks store किए गए है |
- numbers.reverse() = > numbers variable मे stored marks को reverse किया गया है |
- print(numbers) = > ये print() function numbers variable को Show करता है |
Problem 10 :
जब भी किसी online plateform पर कोई order submit किया जाता है तो Customer और Product से
related
informations ली जाती है |
नीचे दिए गए code editor मे एक Python dictionary create करे जिसमे ,
Customer name , Brand name , location details stored हो |
Code Explanation
- details = { = > details ए क variable जिसमे key और value मे Data Store किया गया है |
- print(details) = > ये print() function details variable को Show करता है |
You have completed This Chapter ! 🎉
Now you can choose any one of the following options to test your knowledge :
Help Center
Users and we all help you together .