0% found this document useful (0 votes)
3 views13 pages

Python Programming Basics Guide

Python is a high-level, interpreted programming language created by Guido van Rossum in 1991, known for its simplicity and readability. It is widely used in various fields such as web development, data analysis, and machine learning, and features include easy learning, open-source availability, and extensive libraries. The document also covers Python syntax, data types, operators, and user input/output methods.
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)
3 views13 pages

Python Programming Basics Guide

Python is a high-level, interpreted programming language created by Guido van Rossum in 1991, known for its simplicity and readability. It is widely used in various fields such as web development, data analysis, and machine learning, and features include easy learning, open-source availability, and extensive libraries. The document also covers Python syntax, data types, operators, and user input/output methods.
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

Python

Programming
Fundamentals
What is Python?
✓ Python is a high -level, interpreted, and general -purpose programming
language.
✓ Created by Guido van Rossum in 1991.
✓ I t ’s e a s y t o l e a r n b e c a u s e o f i t s s i m p l e s y n t a x a n d r e a d a b l e c o d e .
Used in:
➢ Web development
➢ Data analysis
➢ Machine learning
➢ Automation
➢ Games and apps
Python Features

EASY TO LEARN AND USE


OPEN-SOURCE AND FREE
C R O S S - P L AT F O R M
HUGE COMMUNITY SUPPORT
EXTENSIVE LIBRARIES AND FRAMEWORKS
IDEAL FOR BOTH BEGINNERS AND PROFESSIONALS
Python Syntax Basics
➢ PYTHON CODE IS WRITTEN IN PLAIN ENGLISH WORDS .

➢ NO NEED TO WRITE {} OR ; LIKE IN OTHER LANGUAGES.

➢ U S E S I N D E N TAT I O N ( S PA C E S ) T O D E F I N E B L O C K S .
Variables and Data Types
➢ VA R I A B L E S S T O R E D ATA O R I N F O R M AT I O N

Data Types:

int → whole numbers (10)

float → decimal numbers (3.14)

str → text ("Hello")

bool → True or False


Variables and Data Types

Python has a set of keywords that are reserved words that cannot be used as variable names,
function names, or any other identifiers
Getting User Input and Output
Use print() to show messages
Use input() to get data from users
Operators
Arithmetic: +, -, *, /, %
Comparison: ==, !=, <, >
Logical: and, or, not
Comparison Operators
Logical Operators
Operator Precedence in Python
Python Quiz
What is the result of this expression?
Qn 1. 5 + 3 * 2
Qn 2. (5 + 3) * 2
Qn 3. 10 - 4 / 2
Qn.4. 4 + 6 / 2 – 3
Qn 5. not 3 > 2
Qn 6. 3 > 2 and 4 < 5
Qn 7. 3 > 2 or 4 > 5
Qn 8. 2 + 3 * 4 ** 2
Qn 9. (2 + 3) * (4 + 1)
Qn 10. print(int((5+3)**(1+2)))
Conditional Statements

You might also like