Tag: thonny

Python Programming Tutorial for Beginners – Part 5 – String concatenation
Tech Tips

Python Programming Tutorial for Beginners – Part 5 – String concatenation

String Concatenation String Concatenation is adding, joining or putting 2 or more strings together. In python, we do this with the plus sign or addition operator. Let's experiment a bit - but first let us create a new file called geezam_python_strings.py and inside that file lets type what I have copied on screen here or just follow me as I go a = "Geezam" b = "python" c = "for" d = "beginners" e = " " words = a + b+ c + d print(words) From the result, we can see we joined the string variables a,b,c and d together into the variable d. The output doesn't look so good so let's add some spaces using the e variable which is literally just a string that is a space. niceWords = a + e + b + e + c + e + d print(niceWords) The strings that we concatenate don't even need to be within a v...
Python Programming Tutorial for Beginners – Part 4 – Basic Operators
Tech Tips

Python Programming Tutorial for Beginners – Part 4 – Basic Operators

Operators are used to perform operations on or to check on variables and values. Think of them as doctors in programming that can either bring you into existence, give you a checkup or modify your identity. There are many types of operators but for this basic tutorial, we will focus on Assignment operators, Arithmetic operators and Comparison operators. Assignment operator You have already used an assignment operator in the form of the equal sign so when we type x = 3 the operator is giving the variable named x the value of the integer number 3. Arithmetic operators Next up we have arithmetic operators which are used to perform mathematical operations on variables and values. So think of addition, subtraction, multiplication and division just to start out. so let's try them out:...
Python Programming Tutorial for Beginners – Part 3 – Printing and commenting
Tech Tips

Python Programming Tutorial for Beginners – Part 3 – Printing and commenting

Displaying or "printing" information to the screen in Python is done using the print() function. So although we have been fiddling with datatypes up to now we haven't displayed them, so first let's try doing that using the variables we were experimenting with before: x = 3 y = 2.2 z = "Cuba" i = True *save the file as geezam_python.py - ensure its a dot py file which is the python file type To show each of them on screen we type the print function with the name of the variable within brackets like so: print() function print(x) print(y) print(z) print(i) Click run in Thonny and voila! the values displayed on the screen. We can also put values directly in the print function by entering them within the brackets. just remember that when it comes to strings we need to use the doub...
Python Programming Tutorial for Beginners – Part 2 – Variables and Data Types
Tech Tips

Python Programming Tutorial for Beginners – Part 2 – Variables and Data Types

Hello and welcome to another post in this python programming for beginners series. In this post, we will be going over variables, data types and the type() function. Now let's get into things by opening the Thonny IDE and let's start. Variables Variables are containers for storing data values - think of them as a bucket or a drawer. So if we have a variable named x and we store the value 3, think of it as a bucket holding the number three. We can have other variables such as y holding the value 2.2 or z with the value "Cuba". Variables don't have to just have short one character names they can be almost anything as long as they don't start with a number, don't have any spaces or have any special characters except underscore. Variable names are also case sensitive so "fancyname" is no...
Python Programming Tutorial for Beginners – Part 1 – Hello and Introduction
Tech Tips

Python Programming Tutorial for Beginners – Part 1 – Hello and Introduction

Hello and welcome to this python programming language basic tutorial series. Who is this tutorial series for? Absolute beginners with no or limited programming knowledge and students currently learning python but those who aren't beginners should be able to learn a thing or two and refresh some of what they might have forgotten. About Python Python is one of the most popular, powerful and most importantly easy to learn programming languages. It is simple but capable of doing* web and software development machine learning artificial intelligence complicated mathematical calculations data science and more Think of it as a giant robot with all kinds of bells and whistles but in this series we just want to be able to stand the robot upright and take a few steps. I...