-
PROGRAMS
In this article, we will learn how to convert a docx file into plain text and then save the content to txt file.
For the conversion, we are going to use a third party package named docx2txt
This tool attempts to generate equivalent plain text files from …
-
PROGRAMS
In this article, we will create a Python script which will check if a particular directory exists on our machine or not if not then the script will create it for us with built in Python functions.
Check If A Directory Exists, If Not, Create It
The OS mod…
-
PROGRAMS
Problem Definition
Create a Python program to print numbers from 1 to 10 using a while loop.
Solution
In programming, Loops are used to repeat a block of code until a specific condition is met. The While loop loops through a block of code as long as a sp…
-
PROGRAMS
Problem Definition
Create a Python program to print numbers from 1 to 10 using a for loop.
Solution
In programming, Loops are used to repeat a block of code until a specific condition is met. A for loop is a repetition control structure that allows you t…
-
PROGRAMS
Problem Definition
Create a Python program to find the smallest among the three given numbers, taking runtime inputs from the user.
In this article, we will show you two methods to address this same problem one being the conventional way and the other be…
-
PROGRAMS
Problem Definition
Create a Python program to swap two numbers taking runtime inputs. Swapping means interchanging, for instance, say we have two variables holding the following values a = 10 & b = 20 after swapping they will interchange the values s…
-
PROGRAMS
Problem Definition
Create a Python program to add two numbers and print the result, taking runtime input from the user.
Solution
Take input from the user save them in variables
Add the numbers and print the result
End
Program
num1 = int(input("Enter fi…
-
PROGRAMS
Problem Definition
Create a Python program to find the largest among the three given numbers.
In this article, we will show you two methods to address this same problem one being the conventional way and the other being the Pythonic way.
Find The Largest…
-
PROGRAMS
Problem Definition
Make a Python program to check if the given string is palindrome or not. A string is a palindrome if it reads same from forward as well as backward for example madam.
Solution
Take the input string from the user and store it in a vari…
-
PROGRAMS
Problem Definition
Make a Python program to check wheater the given number is Even or Odd.
Solution
If a number is exactly divisible by 2 then it is an even number else it is an odd number. In this article, we will use this particular logic to create a P…