Rikesh Nichani

How to Print a String Without ‘\n’ in Python

Strings, Printing and ‘\n’ The printing of a basic string is probably the first program the majority of people, myself included, write in Python –  does print(‘hello world’) sound familiar? From the outset we know the principle is simple, we can pass our string through the print() function and the output will be displayed in …

How to Print a String Without ‘\n’ in Python Read More »

How to Create a Tuple from a String and a List of Strings

Tuples, Strings, and Lists Before we look at creating tuples, as a starting point it would be useful to clarify the meaning of the various terms we will be using throughout this article:  A string is a sequence of characters, and represents one of the main Python data types. A list is used to store …

How to Create a Tuple from a String and a List of Strings Read More »

How to Import Libraries in Python’s exec() Function?

What is the exec() Function exec() is a built-in Python function that is most commonly used to dynamically execute code,  either as a string or object code. To properly understand how we can use exec() to import libraries and modules we need to familiarize ourselves with the syntax of the function itself, as it becomes relevant later: …

How to Import Libraries in Python’s exec() Function? Read More »