

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Why Python is called Dynamically Typed?
Python is a dynamically typed language. What is dynamic? We don't have to declare the type of a variable or manage the memory while assigning a value to a variable in Python. Other languages like C, C++, Java, etc.., there is a strict declaration of variables before assigning values to them. We have to declare the kind of variable before assigning a value to it in the languages C, C++, Java, etc..,
Python don't have any problem even if we don't declare the type of variable. It states the kind of variable in the runtime of the program. Python also take cares of the memory management which is crucial in programming. So, Python is a dynamically typed language. Let's see one example.
Example
## assigning a value to a variable x = [1, 2, 3] ## x is a list here print(type(x)) ## reassigning a value to the 'x' x = True ## x is a bool here print(type(x)) ## we can also redefine 'x' as many times as we want
Output
If you run the above program, it will generate the following results.
<class 'list'> <class 'bool'>
As you see, we didn't declare the type of variable in the program. Python will automatically recognize the type of variable with the help of the value in the runtime.
- Related Questions & Answers
- Is Python Dynamically Typed Language?
- Why is petroleum called black gold?
- Why is a smartphone called smart?
- Why is javascript called Richer Interface?
- Why is __init__() always called after __new__() in python?
- Why is CNG called as clean fuel?
- Greatest number in a dynamically typed array in JavaScript
- Which herb is called a magical herb and why?
- Why is Napoleon Bonaparte called a Great War strategist?
- Why is Greenland called as island and not a continent?
- Why are TV serials called daily soaps?
- Why is Greenland called as an island and not a continent?
- Why Naïve Bayesian is classifications called Naïve?
- Why are South Africans called ‘Protease’?
- Which city of India is called the city of dreams and why?