Python for Beginners – Full Course [Programming Tutorial]
TRANSCRIÇÃO COMPLETA
in this full course you will learn the
basics of python programming
i'm beau carnes with freecodecamp.org
i've previously created one of the most
popular javascript courses on youtube
and i've created many python tutorials
now i've created this complete python
course for beginners you don't need any
previous programming experience to
follow along and all you need to code in
python is a web browser in this course i
will teach you all the core aspects of
the python programming language and i
will simplify the more complex topics
python is considered one of the most
popular programming languages in the
world and it's only growing in
popularity python excels in a wide
variety of scenarios such as shell
scripting task automation and web
development and it's also the language
of choice for data analysis and machine
learning but it can also adapt to create
games and work with embedded devices
we're going to jump right into it so you
can start coding your first python
program as soon as possible to get
started quickly we'll use a replit which
is an online ide that allows users to
code and run programs in a variety of
different languages all in a web browser
and later i'll show you how to get
python set up on your local operating
system after the first project i'll go
into more detail about each of the main
features of python the section is
comprehensive and detailed and in the
final section you will use what you've
been learning to code a blackjack game
with me guiding you every step of the
way throughout the course there will be
a little repetition of some of the key
python programming concepts to make sure
you have a deep understanding of the
language so let's get started we're
going to start by creating a simple rock
paper scissors game and we'll start by
going to replit.com replied provided a
grant that made this course possible and
replie is going to make it super easy to
get up and running really quickly so you
can either sign up or log in
and create an account i'm just going to
use my google account
okay now that you're logged into replit
you can either just click the create
button or this plus button over here to
create a new replit and i'll make sure
to create a python replit but you can
see you can also select all sorts of
different programming languages oh these
are just the ones that start with the
word python but so there's there's tons
of different programming languages you
can select but in this case we are just
going to use python and then i'll click
create reple
okay so let me just kind of show off
replica a little bit
this is where we're going to create our
python code i'm going to zoom in just a
little bit so we're going to write the
code right here and then we can see some
output over on the right side and then
you can create different files over on
the left side here
and then there's some other things like
you can connect to version control
and
if you have environment variables we're
not even going to be discussing those in
this course there's a debugger you can
connect to a database and just some
other things but we're mainly going to
just be using this main.pi program to
write our program and we're going to see
the results in the console so i'm just
going to close this files window so
it's a little bigger here
i'm going to start off by showing you
how to create a variable with python so
this is a rock paper scissors game and
there's going to be a players a player
is going to have a choice and a computer
is going to have a choice so i'm going
to create a variable called player
choice
and i'm going to set that equal to
rock
so let's look at a few components about
this this is the variable name player
choice
and you can see
if you
we use an underscore that's just kind of
the convention for python to use an
underscore if you're going to have a
space in the variable name and we're
going to assign it that's what this
equal sign this is the assign operator
and we're going to assign it to a string
a string is just a word or a collection
of characters like rock and we're going
to put quotation marks around it now we
could have also used a single quotes
instead of double quotes as long as you
use the same quote on each side that's
what's important so we've now created a
variable
called
playerchoice and assigned it to rock and
now we can reference this variable later
and whenever we reference the variable
called playerchoice it's going to
the code is going to automatically
replace that player choice with rock
so this is going to be a very
interactive project i hope you're
following along i hope you have already
got replit loaded up like this now
throughout this project i'm going to
tell you what the next thing to do is
and i want you to try doing it yourself
before you watch what i'm going to do so
periodically you'll want to pause the
video
based on and what i say you and try to
implement what i say
before you come back to the video and
watch me implement it and see if you've
implemented the the same way
so i'm just going to zoom in one more
time and
this is the first thing i want you to do
see if you can make another variable on
the next line so you're going to press
return or enter to go to the next line
and this variable should be called
computer choice and you should set it to
equal
paper
okay so you can pause the video and see
if you can make a variable called
computer choice and set it to equal
paper
so here it's pretty simple here it's
going to start simple but it's going to
get harder as we go so computer choice
equals
paper okay so like i said it's starting
simple but it's going to get more
complex as we go along
if you've done that you've now written
your first line of python code in this
course
okay now i'm going to talk about
functions
a function is a set of code which only
runs when it is called
so i'm going to show you how to put this
code into a function
now one thing about python is that
indentation is very important
so after we create a we define the name
of a function any line of code that's
indented the same amount is considered
within that function
so i'm going to create a new line of
code at the top and i'm going to call it
get
choices
okay so we define the function with def
and get choices and i'm going to select
all these these two lines of code at the
same time and just press the tab key and
that's going to indent all these the
same amount
and you can see sometimes they'll be
squiggly lines and if you hover over
some of the squiggly lines it will tell
you something in this case it just says
the local variable called player choice
is assigned to but never used that's not
necessarily bad it's just it's just
telling us that usually if you create a
variable you're going to want to use it
later well we are going to use it later
we just haven't gotten to it yet so
sometimes the squiggly lines will
indicate there's some sort of error in
DESBLOQUEAR MAIS
Registe-se gratuitamente para aceder a funcionalidades premium
VISUALIZADOR INTERATIVO
Assista ao vídeo com legendas sincronizadas, sobreposição ajustável e controlo total da reprodução.
RESUMO DE IA
Obtenha um resumo instantâneo gerado por IA do conteúdo do vídeo, pontos-chave e conclusões.
TRADUZIR
Traduza a transcrição para mais de 100 idiomas com um clique. Baixe em qualquer formato.
MAPA MENTAL
Visualize a transcrição como um mapa mental interativo. Entenda a estrutura rapidamente.
CONVERSAR COM A TRANSCRIÇÃO
Faça perguntas sobre o conteúdo do vídeo. Obtenha respostas com tecnologia de IA diretamente da transcrição.
APROVEITE MAIS DE SUAS TRANSCRIÇÕES
Inscreva-se gratuitamente e desbloqueie o visualizador interativo, resumos de IA, traduções, mapas mentais e muito mais. Não é necessário cartão de crédito.