Python for Absolute Beginners Transcripts
Chapter: Writing your first lines of code
Lecture: Writing code intro

Login or purchase this course to watch this video and the rest of the course contents.
0:00 The stage has been set
0:01 and it is finally time to write some code.
0:04 We've talked getting Python set up
0:07 so we can run code that we'd write on your machine.
0:10 We've talked about some of the big ideas
0:12 behind programming force code
0:14 what it means to execute source code
0:16 algorithms and even, to a smaller degree, data structures.
0:20 So it's time to start writing code in Python.
0:24 Here's a little bit of Python code
0:25 and we're going to write it in this little environment here.
0:28 What we're going to do, is we're going to start
0:30 from the absolute simplest way that we can explore
0:33 a few basic ideas in Python
0:35 before we get into full-blown
0:37 programs, and editors, and things like that.
0:41 We're going to use this thing called a REPL
0:44 R-E-P-L it stands for, Read. Evaluate. Print. Loop.
0:48 What you do is you type some Python expression in here
0:51 it either gives you an answer
0:53 or if there is no output that doesn't do anything
0:55 and it just evaluates it
0:57 it comes back and it loops around
0:58 and it asks you again
0:59 What do you want to do now? What do you want to do now?
1:02 Real programs are not written this way.
1:04 However, it's the simplest thing
1:06 that we can do to get started.
1:07 In this first chapter
1:09 we're going to work in this Python REPL.
1:12 Afterwards, we're going to put it away
1:13 because they are a lot of disadvantages here.
1:16 For example
1:17 code that we type in here doesn't get saved.
1:19 If we make a mistake
1:20 it's quite hard to edit what we've created in here
1:23 and as long as we're doing complicated things anyway.
1:25 So real programmers
1:27 they don't work here to create programs
1:29 but they do work here to explore little ideas
1:32 and that seems like a great place for us to start.
1:34 This is how it looks if you're on macOS.
1:37 Looks really similar if you're on Linux as well.
1:40 If you're on Windows, it looks a little bit different
1:42 it's going to look like this.
1:43 We're going to go through and do a little bit of setup
1:46 both on macOs and on Windows
1:48 though either of those, you should be all set.
1:50 So don't worry
1:51 we're using one and you're on the other
1:53 we're going to talk about, real quickly
1:55 how to get everything up and going
1:56 get this REPL running the right version
1:58 the right way and so on
2:00 and then we're going to explore
2:01 two core ideas in programming
2:03 variables and reference types
2:05 that's idea 1
2:06 the other one is data types themselves
2:08 like numbers vs. text vs. dates
2:12 that kind of stuff.
2:13 We're going to explore those
2:14 and work with them in this Python REPL
2:17 to get our feet wet and get started
2:18 writing Python code.