AI-powered search & chat for Data / Computer Science Students

Preface

 100 Page Python Intro

Preface This book is a short, introductory guide for the Python programming language. This book is well suited: As a reference material for Python beginner workshops If you have prior experience with ...

Read more at 100 Page Python Intro

Introduction

 100 Page Python Intro

Introduction Wikipedia does a great job of describing about Python in a few words. So, I'll just copy-paste relevant information here: Python is an interpreted, high-level and general-purpose programm...

Read more at 100 Page Python Intro

Numeric data types

 100 Page Python Intro

Numeric data types Python is a dynamically typed language. The interpreter infers the data type of a value based on pre-determined rules. In the previous chapter, string values were coded using single...

Read more at 100 Page Python Intro

Strings and user input

 100 Page Python Intro

Strings and user input This chapter will discuss various ways to specify string literals. After that, you'll see how to get input data from the user and handle type conversions. Single and double quot...

Read more at 100 Page Python Intro

Defining functions

 100 Page Python Intro

Defining functions This chapter will discuss how to define your own functions, pass arguments to them and get back results. You'll also learn more about the print() built-in function. def Use the def ...

Read more at 100 Page Python Intro

Importing and creating modules

 100 Page Python Intro

Importing and creating modules The previous chapters focused on data types, functions (both built-in and user defined) and control structures. This chapter will show how to use built-in as well as use...

Read more at 100 Page Python Intro

Control structures

 100 Page Python Intro

Control structures This chapter will discuss various operators used in conditional expressions, followed by control structures. Comparison operators These operators yield True or False boolean values ...

Read more at 100 Page Python Intro

Exception handling

 100 Page Python Intro

Exception handling This chapter will discuss different types of errors and how to handle some of the them within the program gracefully. You'll also see how to raise exceptions programmatically. Synta...

Read more at 100 Page Python Intro

Debugging

 100 Page Python Intro

Debugging Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. — Brian W. ...

Read more at 100 Page Python Intro

Testing

 100 Page Python Intro

Testing Testing can only prove the presence of bugs, not their absence. — Edsger W. Dijkstra There, it should work now. — All programmers Above quotes chosen from this collection at softwareengineerin...

Read more at 100 Page Python Intro

Installing modules and Virtual environments

 100 Page Python Intro

Installing modules and Virtual environments The standard modules are only a tiny fraction of the vast amount of libraries available for Python. The rich third-party ecosystem is one of the reasons why...

Read more at 100 Page Python Intro

Tuple and Sequence operations

 100 Page Python Intro

Tuple and Sequence operations This chapter will discuss the tuple data type and some of the common sequence operations. Data types like str , range , list and tuple fall under Sequence types. Binary S...

Read more at 100 Page Python Intro

List

 100 Page Python Intro

List List is a container data type, similar to tuple , with lots of added functionality and mutable . Lists are typically used to store and manipulate ordered collection of values. Tuple and Sequence ...

Read more at 100 Page Python Intro

Text processing

 100 Page Python Intro

Text processing This chapter will discuss str methods and introduce a few examples with the string and re modules. join The join() method is similar to what the print() function does with the sep opti...

Read more at 100 Page Python Intro

Mutability

 100 Page Python Intro

Mutability int , float , str and tuple are examples for immutable data types. On the other hand, types like list and dict are mutable. This chapter will discuss what happens when you pass a variable t...

Read more at 100 Page Python Intro

Dealing with files

 100 Page Python Intro

Dealing with files This chapter will discuss the open() built-in function and introduce some of the built-in modules for file processing. open and close The open() built-in function is one of the ways...

Read more at 100 Page Python Intro

Comprehensions and Generator expressions

 100 Page Python Intro

Comprehensions and Generator expressions This chapter will show how to use comprehensions and generator expressions for map , filter and reduce operations. You'll also learn about iterators and the yi...

Read more at 100 Page Python Intro

Set

 100 Page Python Intro

Set set is a mutable, unordered collection of objects. frozenset is similar to set , but immutable. See docs.python: set, frozenset for documentation. Initialization Sets are declared as a collection ...

Read more at 100 Page Python Intro

Executing external commands

 100 Page Python Intro

Executing external commands This chapter will discuss how you can execute external commands from Python, capture their output and other relevant details such as the exit status. The availability of co...

Read more at 100 Page Python Intro

Dict

 100 Page Python Intro

Dict Dictionaries can be thought of as a collection of key-value pairs or a named list of items . It used to be unordered, but recent Python versions ensure that the insertion order is maintained. See...

Read more at 100 Page Python Intro

Command line arguments

 100 Page Python Intro

Command line arguments This chapter will show a few examples of processing CLI arguments using sys and argparse modules. The fileinput module is also introduced in this chapter, which is handy for in-...

Read more at 100 Page Python Intro