Skip to main content

Variable Declaration in Python

                                 Variables

Variables is a container which stores the values in it. Every values in Python has a datatype. Datatypes in Python are numbers, list, tuple, strings, dictionary etc.



Rules for Python Variables

  • A Variable name can contain alpha-numeric characters and underscores (A - Z , a - z, _).
  • A Variable name can start with number or underscore character, but can' t start with a number.
  • Variable name should not be keywords. Keywords are some specific names that are used in Python for some specific function.
  • Variable names in Python are case sensitive. (Height, height, HEIGHT are different).


Variable Declaration


Here we didn't defined data type , as we know Python is dynamically typed so not required to define explicitly.

    Multiple Variable Declaration

        

We can declare multiple variables in a single statements. And you can initialize multiple variables with
the same value.  




Learn Data Science Material which helps to learn concepts in Python, Statistics , Data Visualization, Machine Learning , Deep Learning. And it contains Projects helps to understand the flow of building model , and what are the necessary steps should be taken depending on the data set. Interview Questions helps to crack the interview. 





Learn Python from basics to advanced. 



Join ML in python channel in telegram , Where you can learn every concepts in Python, Statistics, Data Visualization, Machine Learning, Deep Learning.

  

Join Aptitude Preparation channel in telegram , this channel helps to crack any interview.

Comments

Popular posts from this blog

Python Introduction

 Introduction  Python is developed by Guido Van Rossum and released in 1991. Python is high level, interpreted, general purpose programming language. It is one of the top five most used languages in the world. Currently there are 8.2 million developers who code in Python. Python is one of the most preferred languages in the field of Data Science and Artificial Intelligence. Key Features Python is an interpreted language, unlike compiled languages like Java, C, C++, C#, Go etc., Python codes are executed directly even before compiling.  Python is Dynamically typed, no need to mention type of variable before assigning. Python handles it without raising any error. Python codes can be executed on different software or operating systems without changing it. Python supports both Functional and Object oriented programming as it supports creating classes and objects. Python has high number of modules and frameworks support. Python is free and Open Source, which means it is availa...

Percentage Problems on overall percentage change - Module [ 1 ]

                                            Module -1  Let us discuss , if the problems is based on percentage change. 1. If the salary of person increased by 10% and then decreased by 10% , what is the overall percentage change in the salary? Ans :                     Let us assume the salary of person is 100% , then it is increased by 10% so it becomes 110%. Now it is decreased by 10% from 110 that is 11, so                     110 - 11 = 99                    Initial salary is 100% , now the salary is 99% that is 1% change in the percentage.   2. If the cost price of an article is 100 , while selling he increased the cost price by 20% and then decreased 20% . what ...

Importance of data preprocessing in machine learning

                          Data  Preprocessing Data Preprocessing is a technique that is used to convert the raw data into a clean data set. In other words, whenever the data is gathered from different sources it is collected in raw format which is not feasible for the analysis. Need of Data Preprocessing Inaccurate data There are many reasons for missing data such as data is not continuously collected, a mistake in data entry, technical problems with bio-metrics and much more. The presence of noisy data The reasons for the existence of noisy data could be a technological problem of gadget that gathers data, a human mistake during data entry and much more. Inconsistent data  The   presence of inconsistencies are due to the reasons such that existence of duplication within data, human data entry, containing mistakes in codes or names, i.e., violation of data constraints and much more. Steps Involved ...