Hello everybody, it’s Ruby again.
I hope you are all having a lovely week so far.
We started of the session with our usual weekly check-in before we talked about the timelines for our individual projects.
In this session, we learnt Python. Python is a general purpose text-based programming language. Python is widely used because you can get things done with less code than other programming languages. To get started, we downloaded the latest Python Windows installer from https://www.python.org/. After it was installed on our computers, we opened Python from our start menus. The Python shell is part of the integrated development environment.
The 3 greater-than signs (>>>) are called the prompt. We typed in ‘>>> print (‘Hello World’) on the installed software. If you want to save the code, you have to copy the text and paste it on to a Word document.
We used an online editor called Repl.it to be able to run python code. It was easy to sign up to, and I did so using my Google account. The site allows you to save your codes to your account. The link to the online editor is: https://repl.it/
- Variables are a place to store information such as numbers and text. It is also like a label for something. For example, to create a variable named ‘ruby’, we use an equals sign and then tell the program what information the variable should be the label for. Example: ruby = 100 print (ruby). This is assigning a value to a variable.
- A string is a sequence of characters e.g. words or sentences. In Python, we create a string by putting single or double quotes around the text. For example, ruby = (“Why do birds fly?”), then to print what has been assigned to ruby, we type the command, print (ruby)
- We did two exercises. The first exercise was to create a variable called “course” and assign the string value “python”. I created another variable called “rating” and assigned it with an integer value. I used the number 50. The second exercise was to write a program displaying ‘I love Python programming.’
We were given homework to do exercises 3-6 on our Python sheets. I thought the session was fun.
It was Ashmita’s last week before she goes on maternity leave, so at the end of the session, we all had a slice of cake whilst Ashmita received presents for the baby.
Next week, we will be learning how operators work in Python.
I’m looking forward to the session and I’ll see you on another blog post!