Python Basics: Functions and Loops

Functions are the building blocks of almost every Python program. They’re where the real action takes place! In your Python Basics journey, you’ve probably encountered functions such as print(), len(), and round(). These are all built-in functions because they come built into the Python language itself. You can also create user-defined functions that perform specific tasks. Functions break code into smaller chunks and are great for defining actions that a program will execute several times throughout your code. Instead of […]

Read more

Python and PyQt: Building a GUI Desktop Calculator

Even though web and mobile applications appear to have taken over the software development market, there’s still demand for traditional graphical user interface (GUI) desktop applications. If you’re interested in building these kinds of applications in Python, then you’ll find a wide variety of libraries to choose from. They include Tkinter, wxPython, PyQt, PySide, and a few others. In this tutorial, you’ll learn the basics of building GUI desktop applications with Python and PyQt. For this tutorial, you’ll create a […]

Read more

MoCapAct: Training humanoid robots to “Move Like Jagger”

What would it take to get humanoid, bipedal robots to dance like Mick Jagger? Indeed, for something more mundane, what does it take to get them to simply stand still? Sit down? Walk? Move in myriads of other ways many people take for granted? Bipedalism provides unparalleled versatility in an environment designed for and by humans. By mixing and matching a wide range of basic motor skills, from walking to jumping to balancing on one foot, people routinely dance, play […]

Read more

Building a URL Shortener With FastAPI and Python

In this video course, you’ll build a URL shortener with Python and FastAPI. URLs can be extremely long and not user-friendly. This is where a URL shortener can come in handy. A URL shortener reduces the number of characters in a URL, making it easier to read, remember, and share. By following this step-by-step project, you’ll build a URL shortener with Python and FastAPI. At the end of this course, you’ll have a fully functional API-driven web app that creates […]

Read more

Python’s exec(): Execute Dynamically Generated Code

Python’s built-in exec() function allows you to execute arbitrary Python code from a string or compiled code input. The exec() function can be handy when you need to run dynamically generated Python code, but it can be pretty dangerous if you use it carelessly. In this tutorial, you’ll learn not only how to use exec(), but just as importantly, when it’s okay to use this function in your code. In this tutorial, you’ll learn how to: Work with Python’s built-in […]

Read more

How to Check if a Python String Contains a Substring

If you’re new to programming or come from a programming language other than Python, you may be looking for the best way to check whether a string contains another string in Python. Identifying such substrings comes in handy when you’re working with text content from a file or after you’ve received user input. You may want to perform different actions in your program depending on whether a substring is present or not. In this tutorial, you’ll focus on the most […]

Read more

Invasive procedures: Python affordances for performance measurement

When your Python code is too slow, you need to identify the bottleneck that’s causing it: you need to understand what your code is doing. Luckily, beyond pre-existing profiling tools, there are also a variety of ways you can poke and prod Python programs to get a better understanding of what they’re doing internally. This allows you to do one-time introspection, add profiling facilities to your program that you can turn on and off, build custom tools, and in general […]

Read more

Tutorial of Scatter Plot in Base R Language

Introduction In this article, we will understand how to create Scatter Plot in Base R language. R is very popular for providing rich visualization options out of the box. Firs, we will understand the syntax of plot() and then see how to use it for creating scatterplots. Syntax of Scatter Plot plot() function in R The basic syntax for scatterplot plot() function is shown below with commonly used parameters.    

Read more

Using Pi in Python with Numpy, Scipy and Math Library

Using Pi in Python A very trivial scenario that you will come across in coding is using the value of Pi in Python language. And as it turns out, there are multiple libraries Numpy (np.pi) , Scipy (scipy.pi), and Math (math.pi) with which you can use the value of Pi in Python. Let us see them one by one. i) Pi in Numpy – np.pi Here we import the Numpy library as np. And the value of pi can be […]

Read more
1 2 3