Try it on paper first. A hint, the key idea and the worked solution are here when you need them.
Write the command that checks the version of Python in a terminal, for (a) Windows with the Python launcher, (b) macOS, and (c) Linux. Then say what you should see when it works.
Have you tried it?
Work it out on paper first. It is fine to get stuck or make a mistake: that is how we learn. When you are ready, go through the solution one step at a time, and check each step against your own.
Plan. The command is the name of Python and the sign --version.
py --version. (python --version also works when the PATH is set.)python3 --version.python3 --version.What you should see. A line that starts with Python 3. and has two more numbers, for example Python 3.12.4. The first number must be 3.
Check. If you see Python 2.7, you are using the old Python. Use python3 instead.
Answer: py --version (Windows), python3 --version (macOS and Linux). A line with Python 3. and two numbers means that it worked.
Log in to join the discussion.
Loading…