String Formatting

String formatting lets you inject items into a string rather than trying to chain items together using commas or string concatenation. As a quick comparison, consider: player = 'Thomas' points = 33 'Last night, '+player+' scored '+str(points)+' points.' # concatenation f'Last night, {player} scored {points} points.' # string formatting There are three ways to perform … Continue reading String Formatting

Numbers and more in Python

In this tutorial, we will learn about numbers in Python and how to use them. We'll learn about the following topics: 1.) Types of Numbers in Python 2.) Basic Arithmetic 3.) Differences between classic division and floor division 4.) Object Assignment in Python Types of numbers Python has various "types" of numbers (numeric literals). We'll … Continue reading Numbers and more in Python