Learn Python in 7 Days 9781787287778, 1787287777, 9781787288386, 1787288382

Chapter 5: Dictionary; Overview of dictionary; Operations on the dictionary; Accessing the values of dictionary; Deletin

832 66 5MB

English Pages 276 Year 2017

Report DMCA / Copyright

DOWNLOAD FILE

Learn Python in 7 Days
 9781787287778, 1787287777, 9781787288386, 1787288382

Table of contents :
Content: Cover
Copyright
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Customer Feedback
Table of Contents
Preface
Chapter 1: Getting Started with Python
Why Python?
Python applications
Versions€
Implementations of Python
Installation
Installation on Windows platform
Installation on Linux platform
Installation on Mac OS
Notepad++ installation
Python file formats
Python interactive shell
System or environment variables
Setting environment variables in Windows
Setting environment variables in Linux
Setting environment variables in Mac OS (OS 10.9). Writing a simple Hello World! program€Basic Python syntax
Comments in Python
Triple, double and single quotes
Python back slash
String inside the quotes
Escape sequence in Python
String concatenation
Formatted output
Indentation
Summary
Chapter 2: Type Variables and Operators
Variables
Single assignment
Multiple assignment
Data types in Python
Numeric data types or numbers
Integers and long integers
Floating point numbers
Complex numbers
Boolean data type
String data types
American Standard Code for Information Interchange (ASCII) character sets
Conversion functions. Arithmetic expressionsMixed mode arithmetic
Mixed Mode Conversion
Type conversions
Operators
Arithmetic operators
Comparison operators
Variants of assignment operator
Bitwise operators
Logical operators
Membership operators
Identity operators
Operator precedence
Summary
Chapter 3: Strings
Python strings
The subscript operator
Slicing for substrings
Python string methods
String case methods
String strip methods
String split methods
String justify methods€
String Boolean methods
String functions€
Tuple
Creating an empty tuple
Creating tuple with elements. Indexing tupleSlicing of tuple
Unpacking the items€of tuples€
Tuple functions
Operations of tuples
Exercise
Summary€
Chapter 4: Lists
Creating a list
Creating a list with values
Unpacking list values
List operations
Accessing list values
Slicing the list
Updating the list
Deleting values from a list
Addition of Python lists
Multiplication of lists
in operator
List functions
len()
max ()
list ()
sorted ()
List methods
append ()
extend ()
Difference between append and extend.
count ()
index ()
insert()
remove()
pop()
reverse()
List comprehensions
Exercises.

Polecaj historie