Counting number of odd and even numbers in a series – Python Lab Program

This program gets the series of numbers from the user, then saves it to the array. The array is processed using “for” loop to check each element. If the number is even, add +1 to the value of ecount, else add +1 to the value of ocount variables. To check whether the number is even … Read more

Finding Area of Rectangle, Square, Circle and Triangle – Python Lab Program

FORMULA USED:Area of triangle=1/2breadthheight Area of the Square=lengthlength Area of the rectangle=widthheight Area of the circle=Ï€radiusradius ALGORITHM Step 1: Start the program.Step 2: Get the height and breadth of the triangle.Step 3: Calculate area of triangle using the formula. Area of triangle=1/2breadthheightStep 4: Get the length of the square.Step 5: Calculate area of the square … Read more

Temperature Conversion – Python Lab Program

This program gets the choice of the user whether to convert from Fahrenheit to Celsius or Celsius to Fahrenheit then uses IF and ELIF (header) to run the corresponding conversion code within the blocks (suite) this program also includes an ELSE section to run when an invalid choice is given. Note: ch=ch.upper() converts the value … Read more