In this program, you’ll learn to find the ASCII value of a character and display it.
[mai mult...]Python Program to Swap Two Variables
In this example, you will learn to swap two variables by using a temporary variable and, without using temporary variable. In this program, we use the temp variable to hold the value of x temporarily. We then put the value of y in x and later temp in y. In this way, the values get exchanged.
[mai mult...]Calculate the Area of a Triangle with Python
In this program, you’ll learn to calculate the area of a triangle and display it.In this program, area of the triangle is calculated when three sides are given using Heron’s formula.
[mai mult...]Find the Square Root with Python
In this program, you’ll learn to find the square root of a number using exponent operator and cmath module.
[mai mult...]Get Current Date and Time using Python
To get both current date and time datetime.now()
function of datetime
module is used. This function returns the current local date and time.
Syntax: datetime.now(tz)
Parameters:
tz : Specified time zone of which current time and date is required. (Uses Greenwich Meridian time by default.)
Returns : Returns the current date and time in time format.
[mai mult...]Remove multiple elements from a list with Python
Given a list of numbers, write a Python program to remove multiple elements from a list based on the given condition.
[mai mult...]How to validate an IP address with python
Given an IP adress, the task is to validate this IP address with the help of Regex
[mai mult...]Check if an URL is valid or not with Python
Given a URL as a character string str of size N.The task is to check if the given URL is valid or not.
[mai mult...]Adding and Subtracting Matrices in Python
Suppose we have two matrices A and B. A = [[1,2],[3,4]] B = [[4,5],[6,7]] then we get A+B = [[5,7],[9,11]] A-B = [[-3,-3],[-3,-3]][mai mult...]
Categorize Password as Strong or Weak using Regex in Python
Given a password, we have to categorize it as a strong or weak one. There are some checks that need to be met to be a strong password. For a weak password, we need to return the reason for it to be weak.
Conditions to be fulfilled are:
- Minimum 9 characters and maximum 20 characters.
- Cannot be a newline or a space
- There should not be three or more repeating characters in a row.
- The same string pattern(minimum of two character length) should not be repeating.