Skip to main content

Dynamically typed and strongly typed features of python गतिशील रूप से टाइप और दृढ़ता से टाइप की गई भाषा पायथन

Python is both dynamically typed and strongly typed programming language. Here's what each of these terms means:-

पायथन गतिशील रूप से टाइप की गई और दृढ़ता से टाइप की गई प्रोग्रामिंग भाषा है। यहां बताया गया है कि इनमें से प्रत्येक शब्द का क्या अर्थ है:- 

1. Dynamically Typed:- 
In Python, variable types are determined at runtime, not during compilation.It means You don't need to explicitly declare the data type of a variable; it is inferred based on the value assigned to it. For example, you can assign an integer to a variable, and later, without redeclaring, assign a string to the same variable.
   x = 5            # x is an integer
   x = "hello"   # x is now a string

1. गतिशील रूप से टाइप किया गया:- पायथन में, वेरिएबल प्रकार रनटाइम पर निर्धारित होते हैं, संकलन के दौरान नहीं। इसका मतलब है कि आपको किसी वेरिएबल के डेटा प्रकार को स्पष्ट रूप से घोषित करने की आवश्यकता नहीं है; इसका अनुमान उसे दिए गए मान के आधार पर लगाया जाता है। उदाहरण के लिए, आप एक वेरिएबल के लिए एक पूर्णांक निर्दिष्ट कर सकते हैं, और बाद में, पुनः घोषित किए बिना, उसी वेरिएबल के लिए एक स्ट्रिंग निर्दिष्ट कर सकते हैं। 
x = 5 # x एक पूर्णांक है 
x = "hello" # x अब एक स्ट्रिंग है 

2. Strongly Typed:-
Python is strongly typed, meaning that once a variable has a certain data type, operations on it are restricted by that type.It means You cannot perform certain operations between incompatible types without explicit conversion. For instance, you cannot add a string and an integer without converting one of them.
   x = 5
   y = "2"
   z = x + int(y)  # Explicit conversion required

2. सशक्त रूप से टाइप किया गया:- पायथन दृढ़ता से टाइप किया गया है, जिसका अर्थ है कि एक बार जब एक चर में एक निश्चित डेटा प्रकार होता है, तो उस पर संचालन उस प्रकार द्वारा प्रतिबंधित होता है। इसका मतलब है कि आप स्पष्ट रूपांतरण के बिना असंगत प्रकारों के बीच कुछ संचालन नहीं कर सकते हैं। उदाहरण के लिए, आप उनमें से किसी एक को परिवर्तित किए बिना एक स्ट्रिंग और एक पूर्णांक नहीं जोड़ सकते। 
x= 5 
y = "2" 
z = x + int(y) # स्पष्ट रूपांतरण आवश्यक है 

In summary, Python's dynamic typing allows flexibility in changing variable types during runtime, while its strong typing ensures that operations between incompatible types require explicit conversion, promoting code reliability and preventing unintended errors.

संक्षेप में, पायथन की गतिशील टाइपिंग रनटाइम के दौरान परिवर्तनीय प्रकारों को बदलने में लचीलेपन की अनुमति देती है, जबकि इसकी मजबूत टाइपिंग यह सुनिश्चित करती है कि असंगत प्रकारों के बीच संचालन के लिए स्पष्ट रूपांतरण की आवश्यकता होती है, कोड विश्वसनीयता को बढ़ावा मिलता है और अनपेक्षित त्रुटियों को रोका जाता है।

Comments

Popular posts from this blog

Programming with Python Language Tutorial available in hindi and english पाइथन प्रोग्रामिंग टुटोरिअल हिंदी एवं अंग्रेजी भाषा में

 Unit -01 1. Introduction to python (पाइथन भाषा का परिचय) 2. History of Python Programming Language पाइथन प्रोग्रामिंग लैंग्वेज का इतिहास 3. Python Programming Language’s Features and Advantages पायथन प्रोग्रामिंग लैंग्वेज की प्रमुख विशेषताएं 4. Python’s Programming Language's Popularity पाइथन प्रोग्रामिंग लैंग्वेज की लोकप्रियता 5.The Future of Python Programming Language पायथन प्रोग्रामिंग लैंग्वेज का भविष्य 6. The Python Interpreter पायथन इंटरप्रेटर 7. The Python IDLE पाइथन आईडीएलई 8. Installation process of Python IDLE पायथन आईडीएलई की इंस्टालेशन प्रक्रिया 9. Dynamically typed and strongly typed features of python गतिशील रूप से टाइप और दृढ़ता से टाइप की गई भाषा पायथन 10. Basic Data Types of Python पायथन के बेसिक डेटा टाइप 11. Variables in python पायथन में वेरिएबल 12. Expressions in Python पायथन में अभिव्यक्तियां 13. Statements in Python पायथन में कथन 14. Operator's in Python पायथन में ऑपरेटर्स 15. Flow of execution of a python program पाइथन प्रोग्राम के निष्पादन का प्रवाह 16...

Filter function of python

filter function:-  Imagine we have a bunch of things, like a list of numbers, a collection of fruits, or any other group of items. Now, let's say we want to pick out only certain items from that group based on a specific condition. This is where the filter function comes in handy. Let's say we have a list of numbers, and we want to filter out only the even numbers. We define a condition-checking function that checks if a number is even. Then, we pass this function and the list of numbers to the filter function. It goes through each number, applies the condition-checking function, and keeps only the numbers that are even. Finally, it gives us a new list containing only the even numbers. def is_even(num):     return num % 2 == 0 numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] filtered_numbers = list(filter(is_even, numbers)) print(filtered_numbers) Output [2, 4, 6, 8, 10] We can also utilize lambda expressions to define filtering conditions directly within the filter function. nu...

Python Programming Language’s Features and Advantages पायथन प्रोग्रामिंग लैंग्वेज की प्रमुख विशेषताएं

Python is a versatile and popular programming language known for its simplicity and readability. It has a wide range of features that make it suitable for various types of projects. Here are some key features of the Python programming language:- पायथन एक बहुमुखी और लोकप्रिय प्रोग्रामिंग भाषा है जो अपनी सरलता और पठनीयता के लिए जानी जाती है। इसमें कई प्रकार की विशेषताएं हैं जो इसे विभिन्न प्रकार की परियोजनाओं के लिए उपयुक्त बनाती हैं। पायथन प्रोग्रामिंग भाषा की कुछ प्रमुख विशेषताएं निम्न हैं:- 1. Open Source ओपन सोर्स:-   Python is an open-source language, which encourages collaboration and allows developers to contribute to its ongoing development. पायथन एक ओपन-सोर्स भाषा है, जो सहयोग को प्रोत्साहित करती है और डेवलपर्स को इसके चल रहे विकास में योगदान करने की अनुमति देती है। 2. Integrated Development & Learning Environments एकीकृत विकास एवं अध्ययन वातावरण  (IDLEs/IDEs):-  Python has several powerful IDLEs/IDEs, such as PyCharm, VSCode, and Jupyter, that provide too...