Exercise: Getting Familiar with Python
Learn about the control flow and built-in data structures of Python.
We'll cover the following...
We'll cover the following...
Python control flow and data structures
In this exercise, you will practice some basic Python control flow and data structures, including a for
loop, dict
, and list
. This will show you how Python syntax and data structures may be a little different from other programming languages you are familiar with. Perform the following steps to complete the exercise:
-
Type
python3
in Terminal to open a command-line Python interpreter. You should obtain an output similar to the following:Python 3.8.10 (default, Nov 14 2022, 12:59:47) [GCC 9.4.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>>
-
Write a
for
loop in the Command Prompt to print values from 0 to 4 using the following code.