What if you want to find the first item that matches the condition instead of getting a list of items?
Python Tip #3 - Filtering Lists
Selecting elements from a list that satidfy a condition
Sensible Test Data
I am currently working on a project called Peer Feedback, where we are trying to build a nice peer feedback system for college students. We use Canvas Learning Management System (CanvasLMS) API as the data source for our application. All data about the students, courses, assignments, submissions are all fetched from CanvasLMS. The application is written in Python Flask.
Python Tip #2 - Single Line if Statements
```python
Setting a value based on condition
if condition: choice = “Head” else: choice = “Tail”
Python Tip #1 - Setting flags without using if statements
When you have to check for the presence of a value in a list and set a flag based on it, we can avoid typical:
Python Gotcha #1: Extended Assignment Operator and Lists
Extended Assignment Operators - we use them all the time as shorthands for assigning values. Lets see how this works when using multiple identifiers (variables) in terms of simple data like a number.
Peer Pairing Algorithm
Problem Statement
Simplistic Algorithms with Python
I have been working on the problems in Codility to get better at the algorithms and also to expand the way I solve problems in general. One common thing I notice with using Python as the language is that, sometimes the solutions are so simple I wonder if I learnt anything at all.