What is Python?
Python is a widely used high-level programming language created by
Guido van Rossum in the late 1980s. The language places strong
emphasis on code readability and simplicity, making it possible for
programmers to develop applications rapidly.
Like all high level programming languages, Python code resembles
the English language which computers are unable to understand.
Codes that we write in Python have to be interpreted by a special program known as the Python interpreter, which we’ll have to install before we can code, test and execute our Python programs.
Why Learn Python?
If you are new to programming, Python is a great place to start. One of the key features of Python is its simplicity, making it the ideal language for beginners to learn. Most programs in Python require considerably fewer lines of code to perform the same task compared to other languages.
Convinced that Python is the language to learn? Let’s get started...
variables and Data types
Now that we’re done with the introductory stuff, let’s get down to the
real stuff. In this chapter, you’ll learn all about variables and Data types Specifically, you’ll learn what variables are and how to name and declare them.
What are variables?
Variables are names given to data that we need to store and manipulate in our programs. For instance, suppose your program
needs to store the age of a user. To do that, we can name this data
userAge and define the variable userAge using the following
statement.
userAge = 0
After you define the variable userAge, your program will allocate a
certain area of your computer's storage space to store this data. You
can then access and modify this data by referring to it by its name,
userAge. Every time you declare a new variable, you need to give it
an initial value. In this example, we gave it the value 0. We can
always change this value in our program later.
We can also define multiple variables at one go. To do that simply
write
userAge, userName = 30, ‘Peter’
This is equivalent to
userAge = 30
userName = ‘Peter’
Data types
Data types are a fundamental concept in programming that define the type of data that a variable or object can hold. They determine the kind of values that can be stored, the operations that can be performed on those values, and how the values are stored in memory.
For example, integers (int) can store whole numbers, floating-point numbers (float) can store decimal numbers, and strings (str) can store text. Each of these data types has its own properties and methods associated with it.
Here are the types
You might find this informal introductory useful.
Conclusion:
We are still going to cover more concepts related to python probably in our next series, meanwhile take your time and read through this article, don't forget to get on your computer and practice, Enjoy.
#happy coding