LA ILAHA ILLA HU
Allah, Your Lord There Is No Deity Except Him.
Lesson 2: Variables In Python Coding
Variables are containers for storing data values. Python has no command for declaring a variable. A variable is created the moment you first assign a value to it.In other words Python variables do not need explicit declaration to reserve memory space. The declaration happens automatically when you assign a value to a variable.
Python Code For Type Variables
the output will be
25
Tom
You can type/copy paste the above code in any online
compiler or editor or you can even practice to write the
code by hand.
Important to Remember:
Single or Double Quotes do not make a difference.
y = "Tom"
is the same as
Y = 'Tom'
Case-Sensitive:
a = 10
A = "Tom"
print(a)
print(A)
This will create two variables A will not overwrite a.
Important to Note:
In Python a variable name should always start with alphabet and not with nos.
However you can have a number following the alphabetic charrater.
Example:
1A is wrong.
A1 is ok.
Aslo to be noted that space is not allowed between a variable name.
Special charracters other than _ are not allowed.
Exercise 2
Correct the variable name in the box below.
Write the code correctly in the box and check your answer below.
Click Check Answer Button |
---|
Bitwise Operators In Python If elif else Statements In Python Build Your Own Python Calculator The Range Function In Python while Loops In Python for Loops In Python List In Python
Break And Continue Tuples In Python Sets In Python Dictionaries In Python Functions in Python Exploratory Data Analysis - EDA Types of Data Distribution In Python Python Current Time App
Python Tutorials On the Topics of Python Library Python Module Data Science Data Analysis Data Analytics & Machine Learning
Machine Learning Models Of Popular Kaggle Data Set
Asteroid Diameter Prediction Case Study 1-MACHINE LEARNING MODEL Avito Ad Demand Prediction Case Study 2 Using Neural Networks and RNN Machine Learning Model Titanic Disaster Survival Prediction Machine Learning Model- Live Abalone Age Prediction Machine Learning Model- Live AI Based Height And Weight Prediction App LiveMatplotlib
Introduction Plotting PyPlot Markers Line Grid SubPlot Scatter Plot Bars Histograms Labels And Titles Pie Charts Matplotlib Colormap OptionsNumPy
NumPy Intro Creating Arrays Array Indexing Array Slicing Data Types Copy VS View Array Shape Array Reshape Array Iterating Array Join Array SplitArray Search Array Sort Array Filter
NumPy Random
Introduction Data Distribution Permutation Seaborn Normal Data Distribution Binomial Data Distribution Poisson Data Distribution Uniform Data DistributionLogistic Data Distribution Multinomial Data Distribution Exponential Data Distribution Chi Data Distribution Rayleigh Data Distribution Pareto Data Distribution Zipf Data Distribution
NumPy ufunc
Intro Create Your Own ufunc Simple Arithmetic Rounding Decimals Logs NumPy Summations Products Differences NumPy LCM Lowest Common MultipleNumPy GCD Greatest Common Denominator Trigonometric Functions Hyperbolic_Functions Set Operations
Pandas
Introduction to Pandas Pandas Series Dataframes Pandas Read CSV Pandas Read JSON Analyzing Dataframes Pandas Data Cleaning Pandas Cleaning Wrong DataPandas Cleaning Wrong Format Pandas Removing Duplicates