How to sort Numbers in Python without sort function | Example Code

You can use loops statement with if statement to get sort Numbers in Python without sort function. However, you can do it with your own logic using basic code. How to sort Numbers in Python without sort function examples Simple example code sorts the given list in ascending order using a while loop. Using append Read More…


How to check if a number is repeated in a list python | Example code

There are several ways and logics to find the number that is repeated in a list python. Here is the linear solution for it. Output: {2, 3} Python check if there is a repeated value in a list example Simple example code. Method 1 Using for-loop and if statement. Output: Method 2 It will find Read More…


Print integer Python | Example code

To Print an integer in python simply pass the value in the print() function. It will output data from any Python program. Output: 1015 How to print a string and an integer in Python Use comma or string casting to print() a string and an integer. Output: Printing string and integer (or float) in the Read More…


Python check if string is number | Example code

Use Python String isnumeric() Method to check if the string is number or not. This method returns True if all the characters are numeric (0-9), otherwise False. Python checks if the string is a number Example Simple python example to Check if a given string is numeric or not. Output: This function is used to Read More…


How to print numbers in same line in Python | Example code

Put end = ”parameter at the end of the print method, to works print numbers in the same line in Python. Note: default python’s print() function ends with a newline. Example code print numbers in the same line in Python Simple python example code Printing numbers in the same line. Output: Print range of numbers Read More…


Reverse a number(integer) in python | Loop or Recursion

Numbers can be reversed in Python using different methods. Like loop or Recursion can use to reverse a number in python. let us take a look at the Python program to implement the same. Ways to reverse a number in Python Using a Loop Using Recursion Python programs to reverse a number Let’s see the both examples: Read More…