When you multiply each element of a list, you create a new list with each value from the original list multiplied by a specific number.
Continue readingAuthor Archives: Tomasz Decker
Convert Range to a List in Python
If you need to create a list from the range, you can use the list constructor. This constructor will convert a range into a list.
Continue readingConvert Excel Spreadsheet to JSON in Python
To convert an Excel spreadsheet into JSON, first, you have to import the necessary modules: one for reading an Excel file and the second one for converting this data into the JSON format.
Continue readingCheck if a String is Empty in Python
The easiest way to check whether the string is empty is to use the len function. This function is going to return the length of a string.
Continue readingRange of a List in Python
The slice notation in Python is easy to understand. If you want to get a range of a list, you have to give the start and end values.
Continue readingSplit on Whitespace in Python
A whitespace is a character or set of characters that represent vertical or horizontal space.
The split function takes a single optional argument. If you use this function without a parameter, it separates words by single or series of whitespace characters, as long as there is no other character between them.
Continue readingConvert Datetime to Timestamp in Python
To convert datetime to timestamp, first, you have to import the datetime module, assign datetime to a variable and use the timestamp function to convert it into a timestamp.
Continue readingCreate CSV File in PowerShell
To create a CSV file in PowerShell, you can use the following set of commands:
1 2 |
New-Item file.csv Set-Content file.csv 'First Name,Last Name,Age' |
How to Use Command Line with Python
Python allows you to run a script in multiple different ways. One of them is a Command Line. In this lesson, I’ll show you how you can test your python script directly from the command line and python terminal.
Continue readingConvert String to List [Array]
If you want to convert a string to a list, you have a bunch of options; you can do it for entire sentences, words, or characters.
In this lesson, I’ll show you how you can do this using a few different approaches.
Continue reading