0% found this document useful (0 votes)
39 views10 pages

Basics of Python

This document provides an introduction to basic concepts in Python including arithmetic operators, comparison operators, variables, print and input statements, and if/else conditional statements. It explains that Python is a popular, high-level programming language that is easy to start learning. The document then defines common arithmetic operators like addition and subtraction. It also outlines comparison operators such as greater than, less than, and equality. It describes how variables store values that can be changed and printed. It demonstrates how to use print and input statements to output text and accept user input. Finally, it provides an example of using if/else conditional logic to check a condition and print different responses.

Uploaded by

Lalla Suss
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views10 pages

Basics of Python

This document provides an introduction to basic concepts in Python including arithmetic operators, comparison operators, variables, print and input statements, and if/else conditional statements. It explains that Python is a popular, high-level programming language that is easy to start learning. The document then defines common arithmetic operators like addition and subtraction. It also outlines comparison operators such as greater than, less than, and equality. It describes how variables store values that can be changed and printed. It demonstrates how to use print and input statements to output text and accept user input. Finally, it provides an example of using if/else conditional logic to check a condition and print different responses.

Uploaded by

Lalla Suss
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

BASICS OF PYTHON

TANVI

WHAT WILL WE LEARN


UNDERSTANDING PYTHON
ARITHMETIC OPERATORS
COMPARISON OPERATORS
VARIABLES
PRINT STATEMENTS
INPUT STATEMENTS
IF & ELSE STATEMENT
UNDERSTANDING PYTHON
PYTHON IS A HIGH-LEVEL PROGRAMMING and a very popular LANGUAGE, it is
one of the easiest language to start off your journey of coding, and here
i am to help you with it. kindly follow along the course as i will try my
best to make you understand this course with easy explanations :)
ARITHMETIC OPERATORS
OPERATOR MEANING EXAMPLE
+ ADDITION X+1

- SUBTRACTION X-1

* MULTIPLICATION X*1

/ DIVISION X/1
COMPARISON OPERATORS
OPERATOR MEANING EXAMPLE
> GREATER THAN X>1

< LESS THAN X<1

>= GREATER THAN OR EQUAL TO X >= 1

<= LESS THAN OR EQUAL TO X<=1


VARIABLES
VARIABLES ARE LIKE A CONTAINER AND THEY STORE VALUES WHICH CAN BE
CHANGED AND YOU CAN NAME YOUR VARIABLE ANYTHING YOU LIKE EXCEPT SOME
RESERVED KEYWORDS:
NAME = TANVI
print(NAME)
PRINT STATEMENT
PRINT STATEMENT IS A COMMAND IN PYTHON WHICH IS USED TO PRINT LINES THE
COMMAND USED IS:
print("HELLO WORLD")
NOTE: WE ALWAYS NEED TO MAKE SURE THAT THE PRINT WORD SHOULD BE IN SMALL
LETTERS ONLY AND NOT CAPITAL
INPUT STATEMENT
INPUT STATEMENT IS A COMMAND IN PYTHON WHICH ALLOWS THE USER TO GIVE
THEIR INPUT AND IT MAKES YOUR PROJECT MORE INTERACTIVE, THE CODE USED IS:
NAME = INPUT("WHAT IS YOUR NAME?")
print(NAME)
IF AND ELSE STATEMENT
IF AND ELSE STATEMENT IS A COMMAND IN PYTHON WHICH ALLOWS YOU TO GIVE
CUSTOMIZED OUTPUTS AND GIVE THE RESULT ACCORDING TO YOUR NEEDS:
AGE = INPUT("ENTER YOUR AGE: ")
print(AGE)
IF AGE >= 18:
PRINT("YOU ARE AN ADULT")
ELSE:
PRINT("YOU ARE NOT AN ADULT")
THANK YOU!

You might also like