Python Basics: Introduction to Python

 Setting Up Python on Windows:

You can Download Python from 

Official Python distribution hosted on https://python.org 

OR 

from the Windows App Store

When Python finishes downloading, click on the exe file of the bottom of your browser.









About PATH:

  • PATH is an environment variable in Windows that tells the command line where to look for the files and folders.
  • PATH tells the OS where to look for things when you issue commands.
  • Adding Python to PATH allows you to use the python command in a terminal to run Python programs.


When should you add Python to PATH?

  • If you only have one version of Python installed, then you can safely add Python to PATH.
  • If you need multiple versions of Python installed on the same computer, then it is advised not to add Python to PATH.

If you want to add python.exe to the PATH, then check mark the option.

This will Install Python as well as IDlE , pip and Python's documentation.








Python First Program:

= symbol is used by Python to assign values to variables.


Strings and String Methods:

Collection of text in Python are called Strings.

Data type - refers to what kind of data a value represents


Numbers and Math

Here’s a simple Python program that meets the instructions from the image:

num1 = 25000000 # without underscores num2 = 25_000_000 # with underscores print(num1) print(num2)

Explanation:

  • 25_000_000 is the same as 25000000 in Python—underscores just make large numbers easier to read.

  • The program prints num1 and num2 on separate lines as requested.


Comments