python

python

Python 3 program to convert a decimal number to ternary (base 3)

In this python programming tutorial, we will learn how to convert a decimal number to a ternary number.

Read
python

Python program to convert a string to an integer

In this tutorial, we will learn how to convert a string variable to an integer or a float in Python programming language. Python automatically assigns the data type according to the data stored in the variable. Sometimes we have to store a value as a string in a variable and then we need to calculate the sum of this variable with other numeric variables. In that case, we need to convert the string to an integer value (if we know that it will be integer always). For example, take a look at the below program :The first variable ‘firstnumber’ is a string variable and the second variable ‘secondnumber’ is an integer variable. The program is trying to add both of these variables.

Read
python

Python tutorial to call a function using keyword argument

Most new python developer finds ‘keyword arguments’ confusing. If you are coming from a different programming language like Java, this might be a new thing for you.

Read
python

Working with random in python , generate a number,float in range etc.

In this tutorial, we will learn how to create a random number in python. Generating a random number in python is easier than you think. Everything is already defined in a module called random. Just import it and use its inbuilt functions.

Read
python

Python program to capitalize first letter of each words of a string

In this python programming tutorial, we will learn how to capitalize the first letter of each word in a string. We will use one loop and title() method of python string to capitalize the first character of each word.

Read
python

Python program to check if a number is abundant/excessive or not

In this tutorial, we will learn how to find if a number is an abundant/excessive number or not using python. A number is called an abundant number or excessive number if the sum of all of its proper divisors is greater than the number itself. A proper divisor of a number is any divisor of that number other than the number itself. For example, 6 has proper divisor 1,2 and 3. All prime numbers have only one proper divisor i.e. 1 and other numbers have at least two proper divisors.

Read
python

Python program to take user input and check validity of a password

Python program to check the validity of a password. We will write one program to take one password from the user and print out if it is valid or not. We will check different conditions to find if a password is valid or not.

Read
python

Python program to count the frequency of each word in a string

In this python tutorial, we will learn how to count the frequency of each word in a user input string. The program will read all words, find out the number of occurrences for each word and print them out. It will also sort all the words alphabetically.

Read
python

Python print current date,time,hour,minute,increment each

In this tutorial, we will learn how to print the current date, time and hour using python 3. Also, how to increment the day, hour or minute to the current date.

Read
python

How to delete a key from a python dictionary

In this tutorial, we will learn how to delete a key from a dictionary in python 3. The Python dictionary is a mutable and unordered collection. Dictionaries are used to store key-value pairs in Python. Curly braces {} are used to define a dictionary in Python. Each key and its value are separated by a colon.

Read