SPEAKER: We'll use the Python programming language
to demonstrate basic programming concepts
and how to apply them to writing scripts.
We mentioned that there are a bunch of programming languages
out there.
So why pick Python?
Well, we chose Python for a few reasons.
First off, programming in Python usually
feels similar to using a human language.
This is because Python makes it easy to express
what we want to do with syntax that's easy to read and write.
Check out this example.
There's a lot to unpack here so don't worry if you
don't understand it right away.
We'll get into the nitty-gritty details later in the course.
But even if you've never seen a line of code before,
you might be able to guess what this code does.
It defines a list, with names of friends,
and then creates a greeting for each name in the list.
Now, it's your turn to make friends with Python.
Try it out and see what happens.
Throughout this course, you'll execute Python code
using your web browser.
We'll start with some small coding exercises
using code blocks just like the one you experimented with.
Later on, as you develop your skills,
you'll work on larger, more complex coding
exercises using other tools.
Getting good at something takes a whole lot of practice,
and programming in Python is no different.
We recommend that you practice every example we share
in this course on your own.
If you don't have Python installed on your machine,
no worries.
You can still practice using an online Python interpreter.
Check out the next reading for links
to the most popular Python interpreters available online.
Now, I'm sure you're wondering, what the heck is a Python
interpreter?
In programming, an interpreter is the program
that reads and executes code.
Remember how we said a computer program is like a recipe,
with step-by-step instructions?
Well, if your recipe is written in Python,
the Python interpreter is the program
that reads what's in the recipe and translates it
into instructions for your computer to follow.
Eventually, you'll want to install Python on your computer
so you can run it locally and experiment with it
as much as you like.
We'll guide you through how to install Python in the upcoming
course, but you don't have to have
it installed to get your first taste of Python.
You can practice with the quizzes we provide
and with the online interpreters and code pads
that we'll give you links to in the next reading.
We'll provide a whole bunch of exercises for you,
but feel free to come up with your own
and share them in the discussion forums.
Feel free to get creative.
This is your chance to show off your new skills.
[MUSIC PLAYING]
Remember how we mentioned that Python
is simple and easy to use?
Python makes it easy to express the fundamental concepts
of programming like data structures and algorithms
with easy-to-read syntax.
This makes Python a great language
to use to learn programming.
And there are other reasons to pick Python, too.
Python is super popular in the IT industry,
making it one of the most common programming languages
used today.
Python isn't new.
Its first version was released by Guido van
Rossum back in 1991.
Since then, the community that develops it has grown,
and the language has advanced a lot.
Whenever there's a significant change to the semantics
or syntax of the language, a new major version is released.
In 2000, Python 2 was released.
In 2008, we got Python 3.
In this course, we'll use Python 3.7, which came out in 2018.
For many years, Python was considered a beginner's
language and was mostly used for teaching concepts or writing
very small, simple scripts like in this course.
But in recent years, the adoption of Python
has grown dramatically.
One reason for this is that the language
has become more powerful.
It's also because there's more tools
available in Python for a growing range of applications.
You can use Python to calculate statistics, run
your e-commerce site, process images,
interact with web services, and do a whole host of other tasks.
Python is perfect for automation.
It lets you automate everyday tasks
by writing simple scripts that are easy to understand and easy
to maintain.
That's why Python is the language of choice
for lots of people working in IT support, system administration,
and web development.
Not only that, but it's also used
in fast-growing areas of IT, like machine learning or data
analytics.
Last but not least, Python is available for download
on a wide variety of operating systems,
like Windows, Linux, and macOS.
And what's more, Python is so popular in the workplace
that if you are currently working in IT,
you've most likely encountered it already.
And if you're planning for a career in IT,
chances are you'll interact with Python quite a bit.
So there's a whole lot of reasons
for why Python is relevant to today's IT industry.
A large part of programming is learning through trial
and error and asking questions.
So if at any point you get stuck, don't get discouraged.
Making mistakes helps you improve.
The more you see failure or broken code as an opportunity
to learn, the quicker you'll master programming.
I remember the first Python script I ever wrote.
It took a lot of refactoring, debugging,
and testing to get it to work.
I relied on a lot of my teammates
for help and mentorship, and wound up
spending more time on Stack Overflow
than actually writing the code.
Thankfully, you don't have to reinvent the wheel.
There's almost always someone on the internet who's
tried to do what you're doing and can
help point you in the right direction when you're stuck.
Sometimes it takes a village.
It's really important to keep in mind
that even experienced programmers
may need to ask a colleague a question from time to time
or look something up on the internet.
Whether you're a programming novice
or have some experience in software development,
remember, the best programmers overcome challenges
by seeking help or using other resources.
Once you've completed this program,
you'll be well on your way to confidently programming
in basic Python.
There's lots of information online
that will help you continue to develop your programming
skills.
For example, there are lots of online courses
for specific programming languages.
You'll find answers to your Python coding
questions in the official Python documentation.
You can use sites like Stack Overflow
to discuss and share with other developers.
And you can ask questions in our discussion forum.
You can even subscribe to some of the Python mailing lists
to keep in the know on the latest updates to the language.
You're opening the door to the whole world of programming,
and it's super exciting to be joining the development
community.
The most important thing to remember
is that you're never alone.
Any questions you may have any time in your career,
there are resources out there to help you find the answers you
[MUSIC PLAYING]
Although we picked Python for this course,
it's important to note that it's just one of the many coding
languages out there.
Think of a given programming language
as just one of the many powerful tools in your IT toolbox.
Each language has its unique set of pros and cons.
Some run faster than others.
Some are better suited for enterprise applications.
Others are particularly good at crunching numbers.
There are platform-specific scripting languages,
like PowerShell, which is used on Windows,
and Bash, which is used on Linux.
Both are widely used by system administrators
on those platforms.
There are also general-purpose scripting languages
similar to Python, like Perl or Ruby, which
are also widely used for scripting and automation.
JavaScript, which was originally developed
as a client-side scripting language for the web,
is increasingly used as server-side
for a broader set of tasks.
And the list doesn't stop there.
There's a vast array of traditional languages
to explore, like C, C++, Java, or Go.
As you progress in your career in IT,
you'll probably encounter a number of different languages
and learn when to use each of them.
But let's not get ahead of ourselves.
First, we have Python to get our heads around.
A nice feature of learning the basics of programming
in one language is that you can generally
apply the same concepts you learn to other languages.
This means that once you're familiar with Python,
you'll find it easier to pick up new coding languages, as you'll
spot and understand similarities and differences between them.
After all, every language needs to do some common things,
like create variables, control the flow of a program,
read input, and display output, even
if they do these tasks using different approaches.
As we called out earlier, learning a programming language
is somewhat similar to learning a foreign language.
You'll need to grasp the syntax and semantics
for that language.
Luckily for us, once you know the fundamentals
of programming, learning another language
is much easier than learning a second foreign language.
There are a lot more similarities
between programming languages than differences.
To explore some of the similarities and differences
between various scripting languages,
let's take a look at a simple program
that prints the words "Hello, World!"
10 times in three different languages, Python, Bash,
and PowerShell.
As you can see, each language uses a different approach
to printing "Hello, World!"
But look closer, and you'll see similarities, too.
Each language must somehow put text onto the screen.
The command for Python is "print."
For Bash, it's "echo."
And for PowerShell, it's "Write-Host."
Also notice that each language has to count to 10 in some way.
While Python does this by specifying "range(10),"
Bash uses a sequence notation to count from 1 to 10.
PowerShell has the most complex syntax in this example,
but it also boils down to starting at 1
and counting up to 10.
So as we've just seen, there's a whole lot
of programming languages out there.
But don't let that scare you.
In this course, you will only need
to focus on learning Python.
Once you can speak Python, you can go on
to learn any other language you want.