Teach Jenn Tech

Learning Python: Hello Python

Published on July 25 2024 by Jenn Junod

Written by Jenn Junod

In a recent stream, Jenn Junod and Damien delved into Python basics using Kaggle notebooks. They started by exploring Python syntax, variable assignment, and arithmetic operators, which led to some interesting challenges, including swapping variables and calculating candy distribution. The session highlighted both the power and the quirks of Python, especially when dealing with variable swapping and understanding how Python handles operations like modulus for determining remainders.

One of the more amusing moments was when Jenn and Damien had to solve a problem about distributing candy equally, only to be stumped by Python’s modulus operator until they figured out the correct approach. They also touched on Python’s readability, comparing it to other programming languages like JavaScript, which does not enforce indentation as strictly as Python does. The session underscored the importance of understanding Python’s unique features, such as how it handles variable assignments and operations, which can be quite different from other languages.

The stream concluded with a successful completion of the exercises, although not without some frustrations along the way. Jenn and Damien’s persistence paid off as they navigated the challenges, and they hinted at the importance of continuing to practice to build intuition in coding. They ended the stream with plans to continue their Python journey, encouraging viewers to join in and learn alongside them.

Questions from the stream:

1. How do you swap variables in Python without directly reassigning them?

  • The correct approach involves using a temporary variable. For example, temp = a, a = b, and b = temp.

2. What is the modulus operator in Python used for?

  • The modulus operator, represented by %, returns the remainder of a division operation.

3. How do you handle arithmetic operations in Python to follow the correct order of operations?

  • Python follows the order of operations (PEMDAS/BODMAS), and you can use parentheses to ensure the operations occur in the desired order.

Feel free to join future streams to learn more about Python and other coding topics!

Enjoy learning with us?

We’re using Kaggle Learn - Python.

Follow us!

JennDamien
- Twitch- Instagram
- YouTube- LinkedIn
- Twitter
- LinkedIn
← Back to content