100% found this document useful (1 vote)
170 views

Programming and Data Analytics Using Python

This document provides an introduction to the Python programming language. It discusses that Python is an interpreted, object-oriented, high-level programming language that is cross-platform. Variables in Python are used to store values and are named using letters, numbers and underscores. The document also covers Python keywords, basic datatypes like strings and numbers, and how to manipulate strings using methods like title(), upper(), lower(), concatenate with +, and strip whitespace. Mathematical operators that can be used on integers and floats are also presented.

Uploaded by

agilidi
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
170 views

Programming and Data Analytics Using Python

This document provides an introduction to the Python programming language. It discusses that Python is an interpreted, object-oriented, high-level programming language that is cross-platform. Variables in Python are used to store values and are named using letters, numbers and underscores. The document also covers Python keywords, basic datatypes like strings and numbers, and how to manipulate strings using methods like title(), upper(), lower(), concatenate with +, and strip whitespace. Mathematical operators that can be used on integers and floats are also presented.

Uploaded by

agilidi
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 16

Introduction to Python

What is Python?
2

 Python is an interpreted, object-oriented, high-level


programming language with dynamic semantics.

Programming & Data Analytics using Python


What is Python?
3

 Python is a cross-platform programming language, which


means it runs on all the major operating systems.

Programming & Data Analytics using Python


Variables
4

Variables = Value Holders.


Python Interpreter associates the value with the
variable.
A

53.8

Programming & Data Analytics using Python


Variables – Naming Conventions
5

 Variable names can contain only letters, numbers, and


underscores.
 It can start with a letter or an underscore, but not with a number.
 Spaces are not allowed in variable names, but underscores can be
used instead.
 Avoid using Python keywords and function names as variable
names.
 Variable names should be short but descriptive.
 Be careful when using the lowercase letter l and the uppercase letter O
because they could be confused with the numbers 1 and 0.

Programming & Data Analytics using Python


Python Keywords
6

and continue finally is raise


as def for lambda return
assert del from None True
async elif global nonlocal try
await else if not while
break except import or with
class False in pass yield

Reference: https://realpython.com/python-keywords/

Programming & Data Analytics using Python


Access Keywords
7

Programming & Data Analytics using Python


Datatypes
8

Strings:
Numbers:
 Integer
 Float

Programming & Data Analytics using Python


Strings
9

String  a series of characters.


Anything inside quotes (“ ”) or (‘ ’) is considered a
string in Python.

This flexibility allows us to use quotes and


apostrophes within the strings.

Programming & Data Analytics using Python


Changing Case in a String
10

title():

upper() & lower():

Reference: https://www.w3schools.com/python/python_ref_string.asp
Programming & Data Analytics using Python
String Concatenation
11

+ operator:

Programming & Data Analytics using Python


Adding Whitespaces in Strings
12

Whitespace refers to any nonprinting character, such


as spaces, tabs, and end-of-line symbols.
Whitespaces can be used to organize the output so
it’s easier for users to read.

Programming & Data Analytics using Python


Stripping Whitespaces
13

rstrip(), lstrip() & strip():

Programming & Data Analytics using Python


Numbers
14

Mathematical Operators on Integers:

Programming & Data Analytics using Python


Mathematical Operators
15

Floats:

Programming & Data Analytics using Python


THANK YOU

You might also like