Python is a powerful programming language that provides many inbuilt functions to make coding simple and efficient. These functions help programmers perform common tasks like finding length, converting characters, or checking memory addresses without writing extra code.
पायथन एक शक्तिशाली प्रोग्रामिंग भाषा है जो कई अंतर्निहित (inbuilt) फ़ंक्शन्स प्रदान करती है, जिससे कोडिंग आसान और प्रभावी हो जाती है। ये फ़ंक्शन प्रोग्रामर को सामान्य कार्य करने में मदद करते हैं जैसे लंबाई निकालना, अक्षरों का रूपांतरण करना या मेमोरी एड्रेस जांचना, और इसके लिए अतिरिक्त कोड लिखने की आवश्यकता नहीं होती।
(a) id() – Unique Identifier of an Object किसी वस्तु का अद्वितीय पहचानकर्ता
The
id() function returns the unique memory address of an object. Every variable or object in Python is stored in memory, and id() helps us know where exactly it is stored.id() फ़ंक्शन किसी ऑब्जेक्ट का अद्वितीय मेमोरी एड्रेस लौटाता है। पायथन में हर वेरिएबल या ऑब्जेक्ट मेमोरी में संग्रहित होता है और id() से हमें पता चलता है कि वह कहाँ स्थित है।x = 10print(id(x)) # Output: A unique memory address
(b) len() – Length of an Object किसी वस्तु की लंबाई
The
len() function is used to find the number of elements in objects like strings, lists, tuples, etc. It is one of the most commonly used functions in Python.len() फ़ंक्शन का उपयोग स्ट्रिंग, लिस्ट, ट्यूपल आदि जैसे ऑब्जेक्ट्स में तत्वों की संख्या पता करने के लिए किया जाता है। यह पायथन के सबसे अधिक उपयोग किए जाने वाले फ़ंक्शनों में से एक है।name = "Python"print(len(name)) # Output: 6
(c) chr() – ASCII to Character, ASCII से अक्षर में रूपांतरण
The
chr() function converts an ASCII value (number) into its corresponding character. ASCII stands for American Standard Code for Information Interchange.chr() फ़ंक्शन किसी ASCII मान (संख्या) को उसके संबंधित अक्षर में परिवर्तित करता है। ASCII का अर्थ है American Standard Code for Information Interchange।print(chr(65)) # Output: Aprint(chr(97)) # Output: a
(d) ord() – Character to ASCII - अक्षर से ASCII मान
The
ord() function does the opposite of chr(). It converts a character into its ASCII value. This is very useful in encryption, data processing, and character manipulation.ord() फ़ंक्शन chr() का उल्टा काम करता है। यह किसी अक्षर को उसके ASCII मान में बदल देता है। यह एन्क्रिप्शन, डाटा प्रोसेसिंग और अक्षरों के प्रबंधन में बहुत उपयोगी है।print(ord('A')) # Output: 65print(ord('a')) # Output: 97
Comments
Post a Comment