Subscript and superscript are important when you are dealing with different types of formulas. They are useful in math, chemistry, etc.
Continue readingAuthor Archives: Tomasz Decker
Pickle Module for Saving Objects in Python
This lesson is about the Python module called pickle. I’ll tell you what is pickle and how you can use it in Python.
Continue readingInsert Value at the Beginning of the List in Python
The append method adds an element at the end of the list. No function will add an element at the beginning of a list, but there is a method called insert, that you can use to insert an element in any place you want.
Continue readingGet the Day of the Week from a Date in Python
To return the day of the week from a string, you have to import the datetime module and run this code:
Continue readingSort Letters in a String in Python
The easiest way to sort letters is to use the join and sorted functions together.
Continue readingPython append vs extend List Methods
There are two methods in Python that can add an element to a list: append and extend. These methods can cause a lot of confusion among beginner Python programmers.
Continue readingCheck if Dictionary Value is Empty in Python
If you work with dictionaries, sometimes, you will have to check whether a dictionary is empty.
Continue readingGet a List of Dictionary Keys in Python
In Python, you can add dictionary keys to a list. This can be achieved with the keys function of a dictionary.
Continue readingGet the Current Date and Time in Python
To import the current date (year, month, day) and time (hour, minute, second), you have to import the datetime module.
Continue readingGet Data Type in Python
Contrary to other programming languages, such as C++ or Java, you don’t specify the data type when defining a variable in Python, but it doesn’t mean that the variable doesn’t have a type.
You can check the variable type using the type function that returns the type of data.
Continue reading