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
NO LINKS Please
Kamila [148]

Answer:

ok po majsbejwwlaodhd susbvskwmoskwaubsbsiwnwis sisbsbsb is a good 2AM 2AM 2nd edition 2and I am a nanny 2and and u 2122feet 225feet to see how 2nd grade are you 22feet but not yet a lot more because it has alot of people who is the key to the girl in your life of your own life NATO is the most powerful and I was a great person in a sentence and a very nice meeting you had to do nothing babe and she had an affair in a way maker that I am in a relationship with u are in bed now babe and my mom and my dad a lot of my cousn and my kids in the morning and my kids were in the same boat and 5PM was the first of my two 5th grade boys in school to be with u at work now babe on my messenger then the Lord was in bed and she had no probs and no babe to be in Philippines and my kids had to be a good 58 and a little more because I was so happy bday sis had a lot to say about the girl and she was busy with me I will be having dinner with the kids on me sometime next time because she is very good at home now babe ruth is it ur wife is still single forever ni mama ne is a good girl also a big part in her to be the center babe if I will be a good person and I think they 5th 5 and 5 and u have a lot more to lose than me if u have a lot

6 0
2 years ago
Read 2 more answers
The central processing unit​ (cpu) works in conjunction with​ ________ to perform processing.
Mama L [17]
The central processing unit​ (CPU<span>) </span>works in conjunction<span> with​ </span><span>______ to perform processing</span>
4 0
3 years ago
A blank is the full web Address for particular website<br> (Computer technology)
Yuki888 [10]
What do you mean by that
6 0
3 years ago
URGENT HELP PLEASE C+++
gtnhenbr [62]

Answer:

#include using namespace std;

cout << quotient;

Explanation:

not #include ; using namespace std;

; doesn't belong

cout << quotient

forgot the ; at the end

7 0
2 years ago
Which of the following tags contains metadata about the webpage?
Andre45 [30]
I cannot see the options but I am guessing that it is just regular HTML

If that is the case the <meta></meta> tag can be used and should be placed within the <head></head> tag
8 0
3 years ago
Read 2 more answers
Other questions:
  • Consider the following method:
    8·2 answers
  • What system of representation is used for the threaded portions
    12·1 answer
  • Give a linear-time algorithm to sort the ratios of n given pairs of integers between 1 and n. I.e., we need to sort, within O(n)
    5·1 answer
  • Guys i really need help pleasure?
    7·2 answers
  • The continue statement _________.
    11·1 answer
  • Wireless networks use radio frequency (RF) or radio techniques, which allows wireless transmissions to reach out in all directio
    6·1 answer
  • DECIPHER AND SOLVE THIS<br><br> SCC:R<br> D<br> YJOTE VP=GPIMFRT
    15·1 answer
  • A RISC processor has 186 total registers, with 18 global registers. There are 12 register windows, each with 10 locals. How many
    5·1 answer
  • What is output?
    13·1 answer
  • I figured out the secret message in Dad feels good, I can connect the dots
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!