Python program to check if a number is odd or even
Python program to check if a number is odd or even In this example, we will learn how to check if a number is odd or even If a number is completely divisible by 2 then the number will be…
Python program to check if a number is odd or even In this example, we will learn how to check if a number is odd or even If a number is completely divisible by 2 then the number will be…
Python program to find largest of 2 numbers In this example, we will learn how to find the largest number in two given numbers. for this we use decision-making statements if-else. num1 = int(input(‘Enter any number: ‘))num2 = int(input(‘Enter any…
Python program to convert miles to kilometers In this example, we will learn how to convert Miles to kilometers. miles=float(input(‘ Enter any number in miles: ‘)) # 1miles=1.60934 kmkilometers = miles * 1.60934print(‘{0} miles is equal to {1} kilometers’.format(miles,kilometers) ) Output…
What can you do with informatics practices? If you choose Informatics Practices as an elective subject in 11th and 12th then you will get a decent knowledge of programming language and software. You will know how software is created and…
Python program to generate a random number In this program, we will learn how to generate a random number in python To generate a random number in python we use a function randint() #python program to generate a random number…
Python program to convert Celsius to Fahrenheit In this example, we will convert temperature in Celsius to Fahrenheit. To do this we will use the following formula fah = ( cel * 1.8 ) + 32 #python program to convert…
Python program to swap two variables Example 1:- In this example, we will swap the values of two variables with each other. We will use a third variable to temporarily store the value. a=int(input(‘Enter any number: ‘))b=int(input(‘Enter…
Python program to find area of triangle In this python program, we will find the area of a triangle. Example 1:- If Triangle is a Right Angle Triangle #python program to find area of triangle perpendicular=5base=7area= (perpendicular * base) /…
Python program to find area of square In this program, we will learn how to find the area of square. It’s very easy to calculate the area of a square only thing we need to know is the formula for…
Python program to add two numbers with examples In this example, we will learn how to add two numbers in python Example 1:- #python program to add two numbers a=10b=15c=a+bprint(c) Output Note:- In this example, we have given value 10 to…