Variables in Python
Posted August 23, 2019
on:- In: Python Tutorials
- Comments Off on Variables in Python
Objectives:
- How to write variables in Python?
- How to create variables in Python?
- How to add variables in Python?
- How to define variables in Python?
- What are the types of variables in Python?
Code:
x=5 # int y=3.5 # float z="ABC" # String print(x) print(y) print(z)
Please refer above code to define variables in Python and print their values.
The above code clearly states that there are three (3) types of Variables in Python:
- int – Integer Values
- float – Float Values or Decimal Values
- String – String literals
Steps to Run the above code:
- Navigate to the folder/directory where you have saved your python code or file.
- Here I have considered that python file is saved on “c:\>” and the File name is “Variables.py
- Just type the following command now to execute the Python program: c:\> python Variables.py
Download code:
- Navigate to GitHub repository and download the code from here: Variables.py
We conduct Python Training and Workshop for Corporates and College Students, if interested, please write to us on kloudsancyber@gmail.com
Aatul Palandurkar
Life Coach, International Trainer, and Author
https://www.facebook.com/aatulpalandurkar
https://www.instagram.com/aatulpalandurkar/
Tags: Defining Variables in Python, float in Python, How to add variables in Python, How to create variables in Python?, How to define variables in Python, How to write variables in Python, int in Python, integer in Python, python academy nagpur, Python Code, Python Codes, python institute, python institute nagpur, python institutes, Python internship, Python Internship Nagpur, python nagpur, python programming, python trainer, python training, Python Training India, python training institute, python training nagpur, Python Tutorials, python workshop, String in Python, Variables in Python, What are the types of variables in Python