Exercise 1

  1. Write a Python script to prompt users to enter two values; then perform the basic arithmetical operations of addition, subtraction, multiplication, and division on the values.
  1. Write a Python script to prompt users to enter the lengths of a triangle sides. Then calculate the semi perimeters. Calculate the triangle area and display the result to the user. The area of a triangle is (s(s-a)(s-b)*(s-c))-1/2.
  1. Write a Python script to prompt users to enter the first and last values and generate some random values between the two entered values.
  1. Write a Python program to prompt users to enter a distance in kilometres; then convert kilometres to miles, where 1 kilometre is equal to 0.62137 miles. Display the result.
  1. Write a Python program to prompt users to enter a Celsius value; then convert Celsius to Fahrenheit, where T(°F) = T(°C) x 1.8 + 32. Display the result.
  1. Write a program to prompt users to enter their working hours and rate per hour to calculate gross pay. The program should give the employee 1.5 times the hours worked above 30 hours. If Enter Hours is 50 and Enter Rate is 10, then the calculated payment is Pay: 600.0.
  1. Write a program to prompt users to enter a value; then check whether the entered value is positive or negative value and display a proper message.
  1. Write a program to prompt users to enter a value; then check whether the entered value is odd or even and display a proper message.
  1. Write a program to prompt users to enter an age; then check whether each person is a child, a teenager, an adult, or a senior. Display a proper message.
  1. Write a program to prompt users to enter a car’s speed; then calculate fines according to the following categories and display a proper message.
  1. Write a program to prompt users to enter a year; then find whether it is a leap year. A year is considered a leap year if it is divisible by 4 and 100 and 400. If it is divisible by 4 and 100 but not by 400, it is not a leap year. Display a proper message.
  1. Write a program to prompt users to enter a Fibonacci sequence. The Fibonacci sequence is the series of numbers 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, .... The next number is found by adding the two numbers before it. For example, the 2 is found by adding the two numbers before it (1+1). Display a proper message.