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
Precautionary measures to be observed when using ICT tools​
Dafna11 [192]

Answer:

ICT is the abbreviated form of Information and Communication. It included different technologies like mobile phones, computers, USBs etc.

Following are two precautionary measures which should be observed when using any kind of ICT:

  1. Use of Antivirus: It can used to protect anything placed inside the technology especially from hacking and viruses which can create many issues.
  2. Backup Data: Creating a backup of the data stored in the device is important as it can be recalled when the device malfunctions. Backup of the data can be created through using USBs, CDs etc or through cloud storage
7 0
3 years ago
For businesses and organizations under recent compliance laws, data classification standards typically include private, confiden
Anon25 [30]

Answer:

True is the correct answer for the above question.

Explanation:

  • To secure the data is the first rule for any organization because when the data is lost or unsecured the whole system can have the problem.
  • If any person wants to hack the system or any organization then they first choose to hack the data of the system.
  • So there is a Hundred of law in the US taken by the US government at the Federal trade commission act to secure the data of the organization.
  • The above question also states the same which is defined above. Hence It is a true statement.
6 0
3 years ago
Attackers will sometimes put malware on USB drives and leave them in parking lots
kherson [118]

Answer:

True

Explanation:

a lot of people use this as a way to keep things nice and safe, but sometimes thinks don’t go as planned. Don’t really know how else to answer this lol

6 0
1 year ago
Which of the following is an example of data an Earth-observing satellite would collect?
Natalka [10]

Answer:

A

Explanation:

Hopefully this helps

4 0
2 years ago
Assignment
Lena [83]

Answer:

it

is

not

a

big

question

it

is

so

simple

5 0
3 years ago
Other questions:
  • Heatsinks used to protect cpus in computers from overheating, are shaped so that their surface area is very large. why is that?
    5·1 answer
  • A Trojan horse is a program that copies itself repeatedly using up resources and potentially shutting down a network. true or fa
    11·1 answer
  • Which of the following tasks is least effective at preventing a computer virus?
    14·2 answers
  • Wich is the last step in conducting a URL search
    14·2 answers
  • BOTH INTERNATIONAL &amp; INLAND Which procedure(s) shall be used to determine risk of collision?
    14·1 answer
  • In order to average together values that match two different conditions in different ranges, an Excel user should use the functi
    6·1 answer
  • To generate a report with exact results based on specific criteria it is best to base the report on a(n) ____________________ cr
    6·1 answer
  • Data flow is not a major consideration when building an analytics model. T/F
    13·1 answer
  • What does it mean for a heap to be complete?
    7·1 answer
  • What are Manuscript signs​
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!