Getting Started with Python
Language — 1 (WomenInTech)

Begüm Özkısaoğlu Aksu
Machine Learning Turkiye
3 min readMay 27, 2022

Hi everyone! I am one of the Women in Tech Academy project participants supported by the SistersLab Community Volunteers Foundation. The project aims to strengthen the participation of 25 women aged 20–28 in the workforce in the sector with software trainings for 3 months. One of the biggest supports in writing the Python series is this amazing project.

How about we learn Python together? Let’s start 👩🏻‍💻

Python is a widely used high-level programming language for general-purpose programming, created by Guido van Rossum and first released in 1991. Python features a dynamic type system and automatic memory management and supports multiple programming paradigms, including object-oriented, imperative, functional programming, and procedural styles. It has a large and comprehensive standard library.

You can download and install either version of Python here. In addition, some third-parties offer re-packaged versions of Python that add commonly used libraries and other features to ease setup for common use cases, such as math, data analysis or scientific use. See the list at the official site.

Now write the following code in the prompt:

Creating Variables and Assigning Values

Python uses = to assign values to variables. There’s no need to declare a variable in advance (or to assign a data type to it), assigning a value to a variable itself declares and initializes the variable with that value. There’s no way to declare a variable without assigning it an initial value.

Rules for variable naming:

1. Variables names must start with a letter or an underscore.

2. The remainder of your variable name may consist of letters, numbers and underscores.

3. Names are case sensitive.

You can assign multiple values to multiple variables in one line. Note that there must be the same number of arguments on the right and left sides of the = operator:

Simple Mathematical Operators

Python does common mathematical operators on its own, including integer and float division, multiplication, exponentiation, addition, and subtraction. The math module (included in all standard Python versions) offers expanded functionality like trigonometric functions, root operations, logarithms, and many more

Division:

Addition:

Exponentiation:

Any mathematic operator can be used before the ‘=’ character to make an inplace operation:

-= decrement the variable in place

+= increment the variable in place

*= multiply the variable in place

/= divide the variable in place

//= floor divide the variable in place

%= return the modulus of the variable in place

*= raise to a power in place

Conditionals

In Python you can define a series of conditionals using if for the first one, elif for the rest, up until the final(optional) else for anything not caught by the other conditionals.

Loops

for loops iterate over a collection of items, such as list or dict, and run a block of code with each element from the collection.

A while loop will cause the loop statements to be executed until the loop condition is falsey.

If the condition is always true the while loop will run forever (infinite loop) if it is not terminated by a break or return statement or an exception.

When a break statement executes inside a loop, control flow “breaks” out of the loop immediately:

A continue statement will skip to the next iteration of the loop bypassing the rest of the current block but continuing the loop. As with break, continue can only appear inside loops:

You can find more information about the project at this link:

https://www.tog.org.tr/en/

https://sisterslab.co/women-in-tech-academy/

In this article, I told you about Python at the introductory level, Python, Operators, Conditions and Loops. To discuss in my next article. Continue coding 🤟🏻

--

--