Code examples for the Programming tag - developer knowledge base - page 13 (497)

Convert floats to ints in Python, with a simple example: int(3.14) yields 3.
Learn how to create an AI using Python. Follow a step-by-step example to build a basic AI that can make decisions.
Learn how to use slicing to extract a substring from a string in Python with an example.
Transform a list of numbers into a number in Python with a simple example. Learn how to join a list of digits into a single number with a few lines of code.
Create a 2D array in Python with code example: Learn how to declare, initialize, and access elements of a two-dimensional array in Python.
Write a Python interface w/ example: learn how to define class attributes, create methods, and call functions to make your code efficient.
"Create interactive buttons in Python with this easy-to-follow example and have your code respond to user input in no time!"
Create a randomizer in Python with an easy-to-follow example. Learn how to generate numbers, shuffle lists, and more!
How to create a global variable in Python, with a simple example: learn how to make your code accessible across different modules.
Learn how to build your own voice assistant with Python, complete with an example.
Creating a list from a collection in Python is easy - use list comprehension to quickly transform a set into an ordered list. E.g. lst = [x for x in {1,2,3}]
Convert strings to numbers in Python with an example: int("3") to get 3, float("3.14") to get 3.14.
"Learn how to generate random numbers in Python with an easy example."
Learn how to create a Python parser using an example. Create efficient, flexible code to process data from any source.
Make a snake game in Python with this step-by-step guide. Follow the example & create a classic game in no time!
Learn how to capitalize the first letter of a string in Python with an example.
Make a timer in Python with an example: learn how to create a timer to keep track of time in your program with this tutorial.
Learn how to create a graphical user interface (GUI) in Python with an example - from basics to advanced techniques.
Convert strings to ints in Python with this simple example. Learn how to transform str to int with a few lines of code.
Create powerful lists in Python using example code: learn how to store data, access elements, and more.