How To Print Data Type In Python
Python print variable | Python information types in Python iii
How to Print Python variable?
In this Lecture, we are going to learn how to Python print variable and its Python Data Types in Python 3.
You lot can declare a variable without its Data Types in Python. Information technology volition automatically guess it's the data type of any variable with respect to its given value.
Firstly, we discuss what are variables and why we tin can use it in its programme.
Are yous want to know, How to Python print variable? Ohh actually, permit's start…
Variable: it is used to store or hold whatever value in the programme.
Python print variable
Simple write variable'due south proper noun without any data types. Also, initialize its value with an equal sign like.
name= "ABDUL JABBAR"
Don't need to declare cord Data Type in Python. And, you don't need to include the semicolon (;) likewise. As we write the 2nd variable.
age= 23
You don't need to declare information technology's integer data type too.
marks=988.0
Yous don't need to declare the Float Information Type also.
How to make multiple Variables in the single line and likewise initialize its value
Nosotros can make the different variable in a unmarried line that is separated by a comma (,).
Sname, Sage, Smarks = "ABDUL JABBAR", 23, 988.0 #Nosotros tin can access this varibale simply as: print (Sname) Output: ABDUL JABBAR print(Sage) Output: 23 impress (Smarks) Output: 988.0 You tin can access separately every single variable where you lot want to access by its name.
Yous tin can as well assign a single value for more than than i variable.
Like
Ali= Ahsan= Bilal = "White shirt" impress (Ali) Output: White shirt print (Ahsan) Output: White shirt impress (Bilal) Output: White shirt
Same as it is we can access the single value through multiple variables in the program.
Python Information Types in Python iii
- Numbers
- Strings
- Listing
- Tuple
- Dictionary
As nosotros can write near the student's age variable (Sage=23). I said that there is don't need to declare it's the Data type.
Considering in Python variable type can be judged by its value which is given. Nosotros are going to prove that how to judge Python Data Types in Python three automatically.
Nosotros can write the name of a variable with blazon keyword to find it's data types. Like Sage variable as blare
Sage = 27 # student age blazon(Sage) Output: <class 'int'>
Every bit we can declare a string variable and discover it's type Like
Sname = "ABDUL JABBAR" # Student name type(Sname) Output: <class 'string'> Smarks = "988.0" Type(Smarks) Output: <class 'bladder'>
Python automatically stores Value co-ordinate to its Data Types.
Related Video
Video's Credit: sentdex
I hope you can understand how to Python print Variable and its Python Data types in Python 3.
How To Print Data Type In Python,
Source: https://www.stackoftuts.com/python-3/python-print-variable-data-types-in-python-3/
Posted by: stephensexameste1969.blogspot.com
0 Response to "How To Print Data Type In Python"
Post a Comment