Programming Project IdeasOne of the best ways to improve your programming skill is to work on a project that you find genuinely interesting. Here are some ideas for projects or
Read more → Converting integer to string in PythonTo convert an integer to a string, use the str() built-in function. The function takes an
int as input and produces a string as its output. Here are some examples.
Read more → What Is A FunctionUnderstanding functions is crucial when learning to program. Different people need different explanations for functions to really click. So we'll try different
Read more → Python String ljust() explainedIn Python, strings have a built-in method named ljust. The method lets you pad a string with characters up to a certain length. The ljust method means
Read more → Python StringsIn this tutorial you'll learn how to create and work with strings in Python. Examples and practice exercises are included. A string is a sequence of letters.
Read more → Roadmap For Learning To CodeThis post describes what the overall process for learning to code is like. Reading it should give you an overview of what you will be learning as you progress
Read more → What Is PythonIn a nutshell, Python is a popular and powerful programming language that is easy to learn. You write programs in Python to instruct your computer, telling
Read more → Why learn Python first?Python is different from most languages. Python stands out from the rest by being simple, easy to learn, powerful, and can be used in nearly any field.
Read more → What Can You Do With PythonPython is a general-purpose programming language, which means that you can build essentially anything with it. You can use Python to automate boring tasks,
Read more → Convert a string to a list in PythonThis post explains how to convert a string to a list in Python. If you need a list of words in the given string, use the built-in . split() method on the
Read more → Python Enumerate By ExampleIn Python, enumerate() is a built-in function. It is used to compute the indexes of a list while iterating over it. In other words, if you've ever found
Read more → Ways to reverse a Python stringThere are different ways to reverse a string in Python. The usual way to reverse a string is to use slicing with a negative step: Breaking it down, string[:]
Read more → Convert string to int in PythonPython has a built-in function that takes a string and converts it to an integer. Here are examples of how to use it, and how to handle errors.
Read more → Why Learn ProgrammingTechnology is increasingly a large part of our lives. By learning to program, you can take advantage of this fact. Programming is a necessary skill for
Read more → Type ErrorsA TypeError means that you're trying to combine values of different types that are not compatible. For example, the following (wrong) code adds a string
Read more → Syntax ErrorsSyntax means the arrangement of letters and symbols in code. So if you get a syntax error, it usually means you've misplaced a symbol or letter somewhere
Read more → Key ErrorsThis error means that you're trying to access an invalid key in a dictionary. This is typically because the key does not exist in the dictionary. In other
Read more → Lists Of Strings In PythonThis post describes how to work with lists of strings in Python. Lists are one of the most common data structures in Python, and they are often used to
Read more → Index ErrorsYou may sometimes get an IndexError such as the following when running your code: An IndexError means that your code is trying to access an index that
Read more → Name ErrorsWhen you run Python code, you may get a NameError such as the following: The x in the error will vary depending on your program. The error means that Python
Read more → Improved security in the Python interpreterWe would like to thank Brett Hufnagle for responsibly disclosing security issues in our Python interpreter. The reported issues included a sandbox misconfiguration
Read more → How to use JSON in PythonJSON is a way to represent data such as lists, numbers, and strings as text. This post explains how to encode, decode, and work with JSON in Python. To
Read more → Print Vs ReturnPrinting and returning are completely different concepts. print is a function you call. Calling print will immediately make your program write out text
Read more → Debugging By SimulationWhen you're trying to understand someone else's code, or figure out why your own code isn't working, it is incredibly useful to understand precisely what
Read more → How to split a string in PythonStrings are objects in Python. They have a method named split that lets you split the string. For example, here is a string containing commas that we split:
Read more → How To Approach A Coding ExerciseWhen you're struggling with solving a programming exercise, it helps to take a structured approach. First determine what to do. You can do this by writing
Read more → Check if a file exists in PythonSometimes you need to check if a file exists on your file system. Here are different ways to accomplish this. The most Pythonic way to do this is to simply
Read more → How to get unstuck when programmingThis post describes approaches and techniques for getting unstuck when programming, including debugging tips, and the varied ways programmers get stuck.
Read more → Function SyntaxYou can read about what functions are here. Here are some examples of simple functions: Here's how to call the functions: Here are all the parts that go
Read more → Check if a variable is a string in PythonTo check if a variable contains a value that is a string, use the isinstance built-in function. The isinstance function takes two arguments. The first
Read more →