Writing Your First Python Programs

Alexandros Drymonitis · Focal Press eBooks · 2023

In this chapter, the authors learn how to write small Python programs, to undertake various tasks of varying complexity. This is the most common program when starting to learn most programming languages. Many languages provide to capability to include comments in code. Comments are ignored by the compiler and are useful for programmers to either convey information to other programmers about specific parts of their code that might not be very easy to understand, or to keep some notes for themselves. Python includes different data types that can be assigned to variables. These can be roughly categorised in the following groups: numeric, Boolean, sequence, dictionary, and set. Python reserves the keywords True and False for the Boolean data type. In computer programming, a string is a sequence of characters. In Python, strings are encapsulated either in double or single quotes.

Read the paper · More papers on PaperTik