Python 101 – Working with Strings

You will be using strings very often when you program. A string is a series of letters surrounded by single, double or triple quotes. Python 3 defines string as a “Text Sequence Type”. You can cast other types to a string using the built-in str() function.

In this article you will learn how to:

  • Create strings
  • String methods
  • String formatting
  • String concatenation
  • String slicing

Let’s get started by learning the different ways to create strings!

Continue reading Python 101 – Working with Strings

PyDev of the Week: Pablo Galindo Salgado

This week we welcome Pablo Galindo Salgado (@pyblogsal) as our PyDev of the Week! Pablo is a core developer of the Python programming language. He is also a speaker at several Python related conferences. If you’d like to see what projects he is contributing to, you can check out his Github profile.

Let’s spend some time getting to know Pablo better!

Can you tell us a little about yourself (hobbies, education, etc):

I am currently working at Bloomberg L.P. in the Python infrastructure team, supporting all our Python developers and providing critical infrastructure and libraries to make sure everyone has better experience programming in Python. But before working on the Software industry I used to be in academia as a theoretical physicist researching general relativity and in particular, black hole physics. This is something that I still do as a hobby (although without the pressures of publication and funding) because I still love it! For instance, I have given some talks in some Python conferences related to this
( and I continue developing and researching improved algorithms to simulate and visualize different spacetimes. For example, here you have some simulated Kerr Newman black holes with accretion disks around them I have worked on recently:
Continue reading PyDev of the Week: Pablo Galindo Salgado

Python 101 – Learning About Dictionaries

Dictionaries are another fundamental data type in Python. A dictionary is a key, value pair. Some programming languages refer to them as hash tables. They are described as a mapping object that maps hashable values to arbitrary objects.

A dictionary’s keys must be immutable, that is, unable to change. Starting in Python 3.7, dictionaries are ordered. What that means is that when you add a new key, value pair to a dictionary, it remembers what order they were added. Prior to Python 3.7, this was not the case and you could not rely on insertion order.

You will learn how to do the following in this chapter:

  • Create dictionaries
  • Access dictionaries
  • Dictionary methods
  • Modifying dictionaries
  • Deleting from your dictionary

Let’s start off by learning about creating dictionaries! Continue reading Python 101 – Learning About Dictionaries

PyDev of the Week – Abigail Mesrenyame Dogbe

This week we welcome Abigail Mesrenyame Dogbe (@MesrenyameDogbe) as our PyDev of the Week! Abigail is active with the PyLadies organization in Africa and has also helped organize PyCon Africa. Abigail is also a fellow of the Python Software Foundation.

Abigail Dogbe

Let’s spend some time getting to know Abigail better!

Can you tell us a little about yourself (hobbies, education, etc):

I worked with the Internal Audit Department at the Ghana Community Network Services Limited (GCNet) after obtaining a BSc in Computer Science and Engineering from the University of Mines and Technology in Tarkwa, Ghana. Growing up, I struggled with Mathematics and did lots of drawings, paintings, and singing during my hobbies. My hobbies became numerous as I matured so much that I no longer make drawings and paintings but I’ve found happiness in playing with African beads to make accessories and I still sing a lot, although mostly to smaller groups or to myself.

I have a great interest in sports such as volleyball, football and swimming as well. During my final year at the university, I was elected as the captain of the women’s volleyball team. We had lots of training sessions and won a few matches. I am actually impressed with how far the team has come after I completed school.

Also, I have a keen interest in Tech Community Building and I find joy in helping others grow in their career. Continue reading PyDev of the Week – Abigail Mesrenyame Dogbe

Python 101 – Learning About Tuples

Tuples are another sequence type in Python. Tuples consist of a number of values that are separated by commas. A tuple is immutable whereas a list is not. Immutable means that the tuple has a fixed value and cannot change. You cannot add, delete or modify items in a tuple. Immutable objects are useful when you need a constant hash value. The most popular example is the key to a Python dictionary.

In this article, you will learn how to:

  • Create tuples
  • Work with tuples
  • Concatenate tuples
  • Special case tuples

Let’s find out how to create tuples! Continue reading Python 101 – Learning About Tuples

Stuck at Home Python Book Sale

Python is one of the most popular languages in the world. I have been using it myself for over a decade and am still constantly learning new things.

Since so many people are stuck at home, I thought it might be a good time to do a book sale. Now is great time to learn Python or learn a new skill using Python.

With that in mind, I have all my books for sale. Just use the special links below to get the sale price:

There are free chapters available at each of the links. You can download the sample by clicking on the Read Free Sample button on the left.

Feel free to ask me any questions you might have about the books.

What’s New in Python 101 2nd Edition

The original Python 101 was the first book I had ever written. In deciding to write a 2nd edition, I needed to decide what I should keep and what I should remove from the book. What I ended up doing was rewriting the book from the ground up.

Python 101 2nd Ed Kickstarter

In the original book, Python 101 was based on Python 3.5 and had the following sections:

  • Part I – Learning the basics
  • Part II – Learning from the library
  • Part III – Intermediate Odds and Ends
  • Part IV – Tips, tricks and tutorials
  • Part V – Packaging and Distribution

For the 2nd edition, I am dropping part II as most of that information can be covered in later chapters. Now that Python 3.8 is out, I am able to cover such things as

  • f-strings
  • assignment expressions
  • dictionaries being ordered by default
  • type hinting
  • source control
  • review questions for most chapters
  • and more!

And mention other neat things, like sub-interpreters, the futures module, and audit hooks, although those won’t be covered in detail. I am also planning on making the tutorials section into a more proof-of-concept section where you will have little useful scripts that you can take and use. That was already there to some degree, but I think these scripts will be even better than the original ones.

The distribution section will also get a makeover to cover the latest conventions for distributing your code to the Python Packaging Index. The original book’s coverage is out of date.

Also while the first book mentioned lots of different options for creating executables, the new version of the book will focus on only one or two, but it will show how to create a binary for Windows and Mac. I am investigating how to support Linux, but that may or may not be included.

I will be making quite a few chapters available in the free sample available on Leanpub so people can check it out before purchasing.

I hope you’ll check out the book. Feel free to ask questions in the comments or send me an email.

Python 101 2nd Edition will be released in September 2020

PyDev of the Week: Takeshi Komiya

This week we welcome Komiya Takeshi as our PyDev of the Week! Takeshi is a maintainer of Sphinx, Python’s documentation package. Takeshi is also the creator of blockdiag, diagram image generator. If you are interested in seeing some of the other projects that Komiya contributes to, you should check out his Github profile.

Let’s spend some time getting to know Takeshi better!

Can you tell us a little about yourself (hobbies, education, etc):

I am a software engineer from Tokyo, Japan. Now I work at Time Intermedia Corp. as CTO. Time Intermedia is a systems integrator.

I love to have tea when I’m programming. I often bring my laptop to a cafe and enjoy programming all day long. My hobbies include driving all around Japan and watching football games. Continue reading PyDev of the Week: Takeshi Komiya

Python 101 2nd Edition Kickstarter Ending in Two Days

My Kickstarter for the 2nd Edition of Python 101 is ending in less than two days. If you want a signed copy or to purchase one of my other books for a discount, you should check out the Kickstarter as I have lots of good deals on there.

Python 101 2nd Ed Kickstarter

Also, note that the 2nd Edition of Python 101 is a complete rewrite. This book will have all new content and is on track to be one of my longest books. I think you will really like it if you are a beginner learning Python or someone who has been using Python but would like to improve to the next level.

PyDev of the Week: Jessica Garson

This week we welcome Jessica Garson (@jessicagarson) as our PyDev of the Week! Jessica is a developer advocate at Twitter. She also teaches Python at New York University. You can see some of what she’s up to over on Github. Let’s spend some time getting to know her better!

Can you tell us a little about yourself (hobbies, education, etc):

I’m currently a Developer Advocate at Twitter, where I work to make sure developers have good experiences using the Twitter API. What that means is that I write example code, speak at conferences and create blog posts. I also make noise music with Python and perform regularly in the New York area under the artist name, Messica Arson. Before working in technology, I worked on political campaigns.

Jessica Garson

Continue reading PyDev of the Week: Jessica Garson