1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
8_murik_8 [283]
2 years ago
15

Help me understand why it does not loop correctly and how to make the converter a continious loop? What am I doing wrong and how

can I fix it? PYTHON
Code
def metric_english ():

print("Select metric units to convert to English equivilant: ")
print("For kilometers type: 1")
print("For meters type: 2")
print("For centimeters type: 3")
print("\n")
metEng = input("Choose metric units to convert (1, 2, 3): ")
print("\n")
print("Convert to which English units: ")
print("For miles type: 1")
print("For feet type: 2")
print("For inches type: 3")
print("\n")
metEng1 = input("Choose target English units (1, 2, 3): ")
print("\n")
if (metEng and metEng1 == 1):
num1 = input("Enter the number of miles to conver to kilometers: ")
convert2 = num1 * 0.62137
print("RESULT: ", num1, " kilometers = ", convert2, " miles")
elif (metEng and metEng1 == 2):
num1 = input("Enter the number of feet to convert to meters: ")
convert2 = num1 * 0.3048
print("RESULT: ", num1, "meters = ", convert2, " feet")
elif (metEng and metEng1 == 3):
num1 = input("Enter the number of inches to convert to centimeters: ")
convert2 = num1 * 2.54
print("RESULT: ", num1, "centimeters = ", convert2, " feet")
elif (metEng == 1 and metEng1 == 2):
num1 = input("Enter the number of feet to conver to kilometers: ")
convert2 = num1 * 1000
print("RESULT: ", num1, " meters = ", convert2, " miles")
elif (metEng == 1 and metEng1 ==3):
num1 = input("Enter the number of inches to conver to kilometers: ")
convert2 = num1 * 100000
print("RESULT: ", num1, " centimeters = ", convert2, " miles")
elif (metEng == 2 and metEng1 == 1):
num1 = input("Enter the number of miles to convert to meters: ")
convert2 = num1 * 0.0003048
print("RESULT: ", num1, " kilometers = ", convert2, "miles ")
elif (metEng == 3 and metEng1 == 2):
num1 = input("Enter the number of feet to conver to centimeters: ")
convert2 = num1 * 0.0254
print("RESULT: ", num1, " meters = ", convert2, " inches")
elif (metEng == 2 and metEng1 == 3):
num1 = input("Enter the number of inches to conver to meters: ")
convert2 = num1 * 30.48
print("RESULT: ", num1, " centimeters = ", convert2, " feet")
elif (metEng == 3 and metEng1 == 1):
num1 = input("Enter the number of miles to convert to centimeters: ")
convert2 = num1 * 2.54 #add exponent
print("RESULT: ", num1, " kilometers = ", convert2, " inches")



def main ():

print("\nWelcome to the English/Metric conversion utility.")
print("This utility allows you to convert between English units (miles, feet, inches) and metric units (kilometers, metters, centimeters). ")
print("\n")
print("--------------------------------------------------------")
print("\n")
print("Which direction would you like to convert: ")
print("For English Metric type: 1")
print("For Metric to English type: 2")
print("To Quit type: 3")
print("\n")
ans = int(input("Input your answer (1, 2, 3): "))
while ans <= 3:
if (ans == 1):
english_metric()
if (ans == 2):
metric_english()
if (ans == 3):
print("Thanks for using our converter. Goodbye!")
print("\n")
break
else:
print(errorMessage)

main()
Computers and Technology
1 answer:
Aleksandr-060686 [28]2 years ago
4 0

Answer:

The control loop responds to

the overcharged VOUT with a skipped pulse to

regulate VOUT to the correct DC voltage. Other

converters may respond differently when the

minimum on-time is violated. For example, the

fSW may begin to decrease or VOUT may become

regulated to a higher voltage

Explanation:

If you are trying to make a loop run a certain number of time in Python, then...

To repeat something a certain number of times, you may:

1. Use range or xrange for i in range(n): # do something here.

2. Use while i = 0 while i < n: # do something here i += 1.

3. If the loop variable i is irrelevant, you may use _ instead for _ in range(n): # do something here _ = 0 while _ < n # do something here _ += 1.

You might be interested in
When did internet came to existence?
Luden [163]
1982 the Internet protocol was introduced as the standard network protocol on the ARPANET.

1981 access to the ARPANET was expanded.
7 0
3 years ago
What does cro stand for?
mr_godi [17]
It stands for Chief Risk Officer 
8 0
3 years ago
Read 2 more answers
A user is having trouble signing in to the domain from a computer that has been out of service for several months, and nobody el
Pepsi [2]

Answer:

To solve the problem, first,

a) The computer account should be reset.

b) Deactivate the computer from the domain.

c) Then, rejoin it to the domain.

Explanation:

A domain is a network that  allows different computers to function and operate from a common server. A domain may or may not be protected by a password. Setting up a domain provides additional security thereby blocking other computer networks from having access to it. When a person is experiencing difficulties in logging into a domain, there are certain things to be done to resolve the issue.

First, reset the computer account.

Secondly, deactivate the computer from the domain.

Third, Rejoin it back to the domain.

5 0
2 years ago
Which are three possible text formatting actions in wordpad?
DaniilM [7]

Answer:

Font, Bold, italic, colored, centered text...

7 0
3 years ago
GIVING 10 or 20 POINTS for brainliest HELP ASAP!! Instructions Click the links to open the resources below. These resources will
Gnesinka [82]

Answer:

sorry it wont let me do it

Explanation:

5 0
2 years ago
Other questions:
  • A(n) _____ is the highest educational degree available at a community college. master bachelor associate specialist
    13·2 answers
  • Easy STEAM question :)
    15·2 answers
  • Given a scanner reference variable named input that has been associated with an input source consisting of a sequence of integer
    14·2 answers
  • what is the primary way to access applications in windows 8? a. control panel b. start menu c. desktop tiles d. context menu
    7·1 answer
  • A process that allows software-based networked computers to run multiple operating systems and programs and share storage is cal
    5·1 answer
  • Does any one play sniper clash 3d ??? ​
    9·2 answers
  • c++ You are given an array A representing heights of students. All the students are asked to stand in rows. The students arrive
    5·1 answer
  • You have been tasked with designing an Ethernet network. Your client needs to implement a very high-speed network backbone betwe
    8·1 answer
  • Whats wrong with my code for .addEventListener
    11·1 answer
  • The program DebugTwo2.cs has syntax and/or logical errors. Determine the problem(s) and fix the program.// This program greets t
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!