A Byte of Python 1.92 by Swaroop C. H.

By Swaroop C. H.

Show description

Read Online or Download A Byte of Python 1.92 PDF

Similar programming: programming languages books

Objektorientierte Programmiersprache C++: Vollständige Einführung anhand von Beispielen (VDI-Buch) (German Edition)

In diesem Werk werden alle Aspekte der Sprache C++ behandelt, deshalb ist das Buch ebenso für Einsteiger, mit oder ohne Vorkenntnisse über eine andere Programmiersprache, als auch für Umsteiger von anderen Programmiersprachen bzw. C-Programmierer geeignet. Die Darstellung der Sachverhalte erfolgt knapp und systematisch, die Beispiele sind kurz, prägnant und compiler- unabhängig und auf allen Rechnern mit C++ 2.

Extra info for A Byte of Python 1.92

Sample text

0/ reference/ expressions. html#evaluation-order), is provided for the sake of completeness. It is far better to use parentheses to group operators and operands appropriately in order to explicitly specify the precedence. This makes the program more readable. See Changing the Order of Evaluation below for details. } Dictionary display The operators which we have not already come across will be explained in later chapters. Operators with the same precedence are listed in the same row in the above table.

So, we use the built-in len function to get the length and if the length is less than 3, we skip the rest of the statements in the block by using the continue statement. Otherwise, the rest of the statements in the loop are executed and we can do any kind of processing we want to do here. Note that the continue statement works with the for loop as well. Summary We have seen how to use the three control flow statements - if, while and for along with their associated break and continue statements.

In order to observe the dir in action, we define a new variable a and assign it a value and then check dir and we observe that there is an additional value in the list of the same name. We remove the variable/attribute of the current module using the del statement and the change is reflected again in the output of the dir function. A note on del - this statement is used to delete a variable/name and after the statement has run, in this case del a, you can no longer access the variable a - it is as if it never existed before at all.

Download PDF sample

Rated 4.54 of 5 – based on 4 votes