Category Archives: Python (en)

Python: lifehacks for setting up a programming environment

Once you’ve installed Python on your computer, it’s best to take care of the little nuances that make life easier for programmers. Let’s go through the basic settings of the programming environment and Windows for comfortable work: 1. Changing System … Continue reading

Posted in Python (en) | Leave a comment

Python: Basic Text Input and Output Operators

The very first text operations and basic information about Python that helps you start programming right away: # Comments Delimiters ” or “” and escaping characters \’ and \” print(‘Hello world’) – newline end=’…’ – next print will be glued … Continue reading

Posted in Python (en) | Leave a comment

How to write Python code in Notepad++

If you love Notepad and want to program with it, then in the case of the Python programming language, you need to use a special plugin. There are several plugin options for Notepad++ that interpret Python: nppexec; Python script; PyNPP.

Posted in Python (en) | Leave a comment

Python – loops (for, while, break, continue)

Loops in Python are pieces of code that repeat multiple times. range(start,stop,step) – this is how the forLoop loop looks in general, where start and stop describe the actual beginning and end of the loop, including the start point, but … Continue reading

Posted in Python (en) | Leave a comment

Python – ternary conditional statement (if, or, else)

Ternary operator (Ternary operator) – used in line to set conditions in assigning a value to a variable. It is easier to understand this with examples. cat_say = “Mew” me_say = “Hi,cat” if cat_say == “Mew” or cat_say == “Myavki” … Continue reading

Posted in Python (en) | Leave a comment

Python – Boolean Operators and Conditions

Basic conditions in Python: < (one less than the other) > (one more than the other) <= (one is less than or equal to the other) >= (one is greater than or equal to the other) != (one is not … Continue reading

Posted in Python (en) | Leave a comment

Python – branching structures (if else, if, ifelif statements)

The if statement (if) is used to set conditions (if so, then…), for example: cat_say = ‘mew’ if cat_say = ‘mew’ of cat_say = ‘myavki’: ….print(‘Dear, cat! Here’s your food!’) Important: when using if conditions, you need to write double … Continue reading

Posted in Python (en) | Leave a comment

Python – using format in strings

Inside the string, we can specify both fixed text and part of the text defined by the format function, which will consist of separately specified sections: print(“This cat has {0} kittens and a {1}”.format(2,”tail”)) Instead of using numbers inside curly … Continue reading

Posted in Python (en) | Leave a comment

Python – strings, string concatenation and repetition

To assign a string to a variable, enclose the test either in apostrophes ‘…’ or in double quotes “…”: string=’I am a cat’ string=”I am a cat” If the string contains an apostrophe (I’m), then the entire string must be … Continue reading

Posted in Python (en) | Leave a comment

Python – programming environment and additional programs

When you have installed Python, the question arises – how to start learning this language? Should I write commands through the console or do I need to install something else on the computer? There are many programming environments and solutions … Continue reading

Posted in Python (en) | Leave a comment

Python – installation

To install Python on your computer, simply search Google for download python and follow the first link to www.python.org/downloads The easiest way is to click on the bright button with the latest version of Python and then follow the installation … Continue reading

Posted in Python (en) | Leave a comment

Python – forbidden variable names

To find out which names cannot be given to variables in Python, use the command: import keyword keyword.kwlist For Python 3.6 this words are:

Posted in Python (en) | Leave a comment

Python – show result to user

When we write any program in any programming language, sooner or later we want the result of our programming to be shown to the user. For this we use the command: print(…) must be lowercase

Posted in Python (en) | Leave a comment

Python – Data Types (Objects)

In the Python programming language, there are three types objects (or data types – data type): scalar (indivisible) int (integers, integer, e.g. 5); float (real number, numbers with a semicolon, for example: 5.5); bool(true/false, true/false); non-scalar (divisible) str (string, string … Continue reading

Posted in Python (en) | Leave a comment