Escrito por estudiantes que aprobaron Inmediatamente disponible después del pago Leer en línea o como PDF ¿Documento equivocado? Cámbialo gratis 4,6 TrustPilot
logo-home
Notas de lectura

Nothing

Puntuación
-
Vendido
-
Páginas
332
Subido en
02-09-2023
Escrito en
2023/2024

Lecture notes of 332 pages for the course Programing at Programing (NA)

Institución
Grado

Vista previa del contenido

, Python Basics
With Illustrations from the Financial Markets




QuantInsti Quantitative Learning Pvt. Ltd.
- India -

,Contents

1 Introduction 1
1.1 What is Python? . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Where is Python used? . . . . . . . . . . . . . . . . . . . . . . 2
1.3 Why Python? . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.4 History of Python . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.5 Python 3 versus Python 2 . . . . . . . . . . . . . . . . . . . . 7
1.6 Key Takeaways . . . . . . . . . . . . . . . . . . . . . . . . . . 10

2 Getting Started with Python 11
2.1 Python as a Calculator . . . . . . . . . . . . . . . . . . . . . . 11
2.1.1 Floating Point Expressions . . . . . . . . . . . . . . . 14
2.2 Python Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.2.1 Literal Constants . . . . . . . . . . . . . . . . . . . . . 17
2.2.2 Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2.2.3 Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2.2.4 Comments . . . . . . . . . . . . . . . . . . . . . . . . . 19
2.2.5 print() function . . . . . . . . . . . . . . . . . . . . . 20
2.2.6 format() function . . . . . . . . . . . . . . . . . . . . 22
2.2.7 Escape Sequence . . . . . . . . . . . . . . . . . . . . . 23
2.2.8 Indentation . . . . . . . . . . . . . . . . . . . . . . . . 24
2.3 Key Takeaways . . . . . . . . . . . . . . . . . . . . . . . . . . 25

3 Variables and Data Types in Python 27
3.1 Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
3.1.1 Variable Declaration and Assignment . . . . . . . . . 27
3.1.2 Variable Naming Conventions . . . . . . . . . . . . . 28
3.2 Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
3.2.1 Integer . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

i

, 3.2.2 Float . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
3.2.3 Boolean . . . . . . . . . . . . . . . . . . . . . . . . . . 34
3.2.4 String . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
3.2.5 Operations on String . . . . . . . . . . . . . . . . . . . 38
3.2.6 type() function . . . . . . . . . . . . . . . . . . . . . . 41
3.3 Type Conversion . . . . . . . . . . . . . . . . . . . . . . . . . 42
3.4 Key Takeaways . . . . . . . . . . . . . . . . . . . . . . . . . . 45

4 Modules, Packages and Libraries 47
4.1 Standard Modules . . . . . . . . . . . . . . . . . . . . . . . . . 50
4.2 Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
4.3 Installation of External Libraries . . . . . . . . . . . . . . . . 53
4.3.1 Installing pip . . . . . . . . . . . . . . . . . . . . . . . 54
4.3.2 Installing Libraries . . . . . . . . . . . . . . . . . . . . 54
4.4 Importing modules . . . . . . . . . . . . . . . . . . . . . . . . 56
4.4.1 import statement . . . . . . . . . . . . . . . . . . . . . 56
4.4.2 Selective imports . . . . . . . . . . . . . . . . . . . . . 57
4.4.3 The Module Search Path . . . . . . . . . . . . . . . . . 59
4.5 dir()function . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
4.6 Key Takeaways . . . . . . . . . . . . . . . . . . . . . . . . . . 63

5 Data Structures 65
5.1 Indexing and Slicing . . . . . . . . . . . . . . . . . . . . . . . 65
5.2 Array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
5.2.1 Visualizing an Array . . . . . . . . . . . . . . . . . . . 67
5.2.2 Accessing Array Element . . . . . . . . . . . . . . . . 68
5.2.3 Manipulating Arrays . . . . . . . . . . . . . . . . . . . 68
5.3 Tuples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
5.3.1 Accessing tuple elements . . . . . . . . . . . . . . . . 71
5.3.2 Immutability . . . . . . . . . . . . . . . . . . . . . . . 72
5.3.3 Concatenating Tuples . . . . . . . . . . . . . . . . . . 72
5.3.4 Unpacking Tuples . . . . . . . . . . . . . . . . . . . . 73
5.3.5 Tuple methods . . . . . . . . . . . . . . . . . . . . . . 73
5.4 Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
5.4.1 Accessing List Items . . . . . . . . . . . . . . . . . . . 75
5.4.2 Updating Lists . . . . . . . . . . . . . . . . . . . . . . 75
5.4.3 List Manipulation . . . . . . . . . . . . . . . . . . . . . 77
5.4.4 Stacks and Queues . . . . . . . . . . . . . . . . . . . . 80

ii | Table of Contents

Escuela, estudio y materia

Grado

Información del documento

Subido en
2 de septiembre de 2023
Número de páginas
332
Escrito en
2023/2024
Tipo
NOTAS DE LECTURA
Profesor(es)
Nandini
Contiene
Todas las clases

Temas

$18.89
Accede al documento completo:

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Conoce al vendedor
Seller avatar
dangetinandini

Conoce al vendedor

Seller avatar
dangetinandini Self
Seguir Necesitas iniciar sesión para seguir a otros usuarios o asignaturas
Vendido
-
Miembro desde
2 año
Número de seguidores
0
Documentos
1
Última venta
-

0.0

0 reseñas

5
0
4
0
3
0
2
0
1
0

Documentos populares

Recientemente visto por ti

Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes