Programming 

Python List reverse()

This tutorial shows you everything you need to know to help you master the essential reverse() method of the most fundamental container data type in the Python programming language. Definition and Usage: The list.reverse() reverses the order of the elements in the list. If you want to create a new list with reversed elements, use slicing with negative step size list[::-1]. Here’s a short example: >>> lst = [1, 2, 3, 4] >>> lst.reverse() >>> lst [4, 3, 2, 1] In the first line of the example, you create the…

Read More
Programming 

Python List pop()

This tutorial shows you everything you need to know to help you master the essential pop() method of the most fundamental container data type in the Python programming language. Definition and Usage: The list.pop() method removes and returns the last element from an existing list. The list.pop(index) method with the optional argument index removes and returns the element at the position index. Here’s a short example: >>> lst = [1, 2, 3] >>> lst.pop() 3 >>> lst [1, 2] In the first line of the example, you create the list…

Read More

Real Python: Python Scope & the LEGB Rule: Resolving Names in Your Code

The concept of scope rules how variables and names are looked up in your code. It determines the visibility of a variable within the code. The scope of a name or variable depends on the place in your code where you create that variable. The Python scope concept is generally presented using a rule known as the LEGB rule. The letters in the acronym LEGB stand for Local, Enclosing, Global, and Built-in scopes. This summarizes not only the Python scope levels but also the sequence of steps that Python follows…

Read More
Programming 

Impressions from the first Zerynth Continuous Learning Webinar – UX Design for IoT Projects

We had our first Zerynth Continuous Learning webinar last week. If you’ve watched the webinar you got to learn about UX design for IoT projects straight from the experts. For this first webinar, Daniele Mazzei, our Co-founder, and Chief Innovation Officer talked about User Experience design in the context of IoT. Daniele is an Assistant Professor at the Computer Science department of the University of Pisa where he teaches Human Machine Interface and Social Robotics. And if you haven’t, here’s a little snippet, to show you how it went: For…

Read More

Knowledge and engineering ingenuity, not hype — Zerynth in 2020s

In an iconic scene from Superman III, a drunk Man of Steel appears in the skies above Pisa — where the Zerynth HQ is — and pushes the leaning tower until its straight. Seeing this, a local souvenir shop owner goes berserk. His entire stock of tower models has just gone obsolete. He slams them into the pavement and the tiny towers shatter into bits. When I reflect on the past decade, I identify with the poor shop owner. Unusual market trends — some as random and illogical as the…

Read More

Make a 2D Side-Scroller Game With PyGame

In this course, you’ll learn about creating games using Python and the library PyGame. By the end of this course, you’ll be able to: Draw items on your screen Play sound effects and music Handle user input Implement event loops Describe how game programming differs from standard procedural Python programming This primer assumes you have a basic understanding of writing Python programs, including user-defined functions, imports, loops, and conditionals. You should also be familiar with how to open files on your platform. A basic understanding of object-oriented Python is helpful…

Read More

Python List remove()

How can you insert an element at a given index in a given list? Python’s remove() method is your friend. This tutorial shows you everything you need to know to help you master an essential method of the most fundamental container data type in the Python programming language. Definition and Usage: The list.remove(element) method removes the first occurrence of the element from an existing list. It does not, however, remove all occurrences of the element in the list! Here’s a short example: >>> lst = [1, 2, 99, 4, 99]…

Read More

Mike Driscoll: PyDev of the Week: Jessica Garson

This week we welcome Jessica Garson (@jessicagarson) as our PyDev of the Week! Jessica is a developer advocate at Twitter. She also teaches Python at New York University. You can see some of what she’s up to over on Github. Let’s spend some time getting to know her better! Can you tell us a little about yourself (hobbies, education, etc): I’m currently a Developer Advocate at Twitter, where I work to make sure developers have good experiences using the Twitter API. What that means is that I write example code,…

Read More
Programming 

Python List insert() Method

How can you insert an element at a given index in a given list? Python’s insert() method is your friend. This tutorial shows you everything you need to know to help you master an essential method of the most fundamental container data type in the Python programming language. Definition and Usage: The list.insert(i, element) method adds an element element to an existing list at position i. All elements j>i will be moved by one index position to the right. Here’s a short example: >>> lst = [1, 2, 3, 4]…

Read More

Reuven Lerner: Announcing: Free, weekly “Python for non-programmers” workshop

This is a tough time for the world. Wherever you live, you have likely been affected by covid-19, the coronavirus that has been making its way to every country, city, and town. Many countries, companies, and individuals are now restricted to their homes.  This can be frustrating in many ways.  Moreover, I’m not alone in believing that we’re about to see some very troubled times for the world economy. I’ve been trying to decide what I can do, as a Python instructor, to help people in these trying times.  And…

Read More