From the course: Programming Foundations: Fundamentals
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
Running Python on the command line on Mac - Python Tutorial
From the course: Programming Foundations: Fundamentals
Running Python on the command line on Mac
- One way to execute or run your Python code is by using the command line. Let's open up Terminal and try out a few commands. Let's go ahead and launch the Python interpreter. We'll use the Python three command. Now we're inside of our Python prompt. This means the computer's ready to take our instructions. Let's try out a simple math problem. Two plus two. First, we'll try it with what is two plus two? Uh oh, we get a syntax error. We call it that syntax refers to the rules of a programming language. Syntax errors happen when you write code that breaks the expected rules. In this case, we wrote our code in plain English, but the interpreter doesn't understand English, only Python. Let's try this again. This time, we'll take two plus two, and just like that, we get four. That's because two plus two is a valid Python expression. Let's try another one. Two plus, and then enter. Once again, another syntax error.…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
Why Python?1m 52s
-
(Locked)
Installing Python on a Mac4m 19s
-
(Locked)
Installing Python on Windows1m 49s
-
(Locked)
Running Python on the command line on Mac3m 8s
-
(Locked)
Running Python on the command line on Windows4m 10s
-
(Locked)
Installing Visual Studio Code on a Mac3m 43s
-
(Locked)
Installing Visual Studio Code on Windows3m 40s
-
(Locked)
Running Python in an IDE3m 37s
-
(Locked)
Basic statements and expressions4m 2s
-
(Locked)
Troubleshooting issues4m 2s
-
-
-
-
-
-