CodeTantra Python Programming L14 Solution

In this blog post, you will find all the Solutions to the L14 questions of the Codetantra Python Programming Course. Here are the answer to these question:-

codetantra python programming l14

Q1 :- L14/Introduction to Algorithms/Understanding Problem Solving :- Select the correct statements given below.

Problem solving is a systematic approach to define and solve a problem.

The order to solve a problem is to first provide the solution followed by the problem definition

Few techniques are required to solve a particular problem which help in deriving a logic to solve the problem

Algorithms Flowcharts. Pie Charts are some of the techniques of problem solving

Algorithms Flowcharts, Pseudo Code and Programs are the techniques used to solve a problem.

Q2 :- L14/Introduction to Algorithms/What is an Algorithm? :- Select the correct statements given below.

Algorithm means a mathematical formula.

It is very easy to write the code in any programming language after developing an algorithm for that problem.

Only one algorithm can be written for any problem

After a finite number of steps an algorithm must reach an end state

Q3 :- L14/Introduction to Algorithms/Qualities of a Good Algorithm :- Select all correct statements given below.

The more time an algorithm takes to execute, the better is the algorithm.

The lesser memory a program takes to execute, better is the algorithm.

Only one algorithm can be written for any problem and is the only preferred way.

The quality of an algorithm is determined by the person who wrote it.

Q4 :- L14/Introduction to Algorithms/Algorithm to convert Miles into Kilometers :- Write a program for converting a distance given in miles to kilometers. Take the distance from the console in the format of float.

miles = int(input(“miles: “))

if (miles > 0):

        kil = miles * 1.609

        print(“kilometers:”,kil)

else:
        print(“not positive value”)

Q5 :- L14/Introduction to Algorithms/Algorithm to convert Fahrenheit into Celsius :- Write a program to convert the temperature given in Fahrenheit to Celsius and vice versa.

temp = input(“temp with unit: “)

a = temp[0:-1]

unit = temp[-1]

units = [‘F’, ‘C’, ‘f’,’c’]

if unit not in units:

        print(“unrecognized unit:”, unit) exit

else:

        if(unit == ‘F’ or unit==’f’):

                     c = (5/9)*(int(a)-32)

                     print(“{} F = {} C”.format(a, round(c,2)))

        else:

                     f = (9/5)*int(a) + 32

                     print(“{} C = {} F”.format(a, round(f,2)))

Hope this blog post was helpful to you and you have got the answer to your question. Thank you for visiting our blog. If you have any doubts about any coding questions then let us know in the comments section we will answer them as soon as possible. Till then check out our more blog posts.

Leave a Comment

Your email address will not be published. Required fields are marked *