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
EleoNora [17]
2 years ago
12

A loop that will output only the names that come before "Thor" in the alphabet from the names list.

Computers and Technology
1 answer:
matrenka [14]2 years ago
3 0

names = ["Kevin", "Joe", "Thor", "Adam", "Zoe"]

names.sort()

for x in names:

   if x == "Thor":

       break

   else:

       print(x)

I made up my own names for the sake of testing my code. I wrote my code in python 3.8. I hope this helps.

You might be interested in
K
ollegr [7]
True??????????????????????????
7 0
3 years ago
Read 2 more answers
Tab stops are useful when you want to?
Lelu [443]
Indentation and alignment are very noticeable on a printed page, so you will probably want to set the tab stops in your document precisely how you want them.


8 0
3 years ago
The function below takes two arguments: a dictionary of strings (keys) to integers (values) a_dict and a list of strings key_lis
vitfil [10]

Answer:

  1. def getData(a_dict, key_list):
  2.    result = []
  3.    for key in key_list:
  4.        result.append(a_dict[key])
  5.    
  6.    return result  
  7. result = getData( {"puffin": 5, "corgi": 2, "three": 3} , ["three", "corgi"])
  8. print(result)

Explanation:

Let's define a function <em>getData() </em>with two parameters,<em> a_dict </em>and <em>key_list</em> as required by the question (Line 1).

Since the function is to return a list of associated values of dictionaries, a new list,<em> result</em>,  is declared and initialized with empty values (Line 2).

Next, use for-loop to traverse through every string in the input <em>key_list </em>(Line 4) and use the traversed key to address the value in the<em> a_dict </em>and add it to the <em>result</em> list (Line 5)

At last, return the <em>result </em>list as output (Line 7)

We can test the function using the test case from the question and we shall see the output as follows:

[3, 2]

8 0
2 years ago
Explain how you can compare the size of product to the size of a factor when multiplying fractions without actually doing the mu
777dan777 [17]
You can multiple or dived
4 0
3 years ago
Match each item with a statement below. - Uses two keys: one to encrypt data and one to decrypt data - Encryption algorithm used
Vsevolod [243]

Answer:

Does increased security provide comfort to paranoid people? Or does security provide some very basic protections that we are naive to believe that we don't need? During this time when the Internet provides essential communication between literally billions of people and is used as a tool for commerce, social interaction, and the exchange of an increasing amount of personal information, security has become a tremendously important issue for every user to deal with.

Explanation:

5 0
2 years ago
Other questions:
  • What is the LER for a rectangular wing with a span of 0.225m and a chord of 0.045m
    12·1 answer
  • Write an interactive Python calculator program. The program should allow the user to type a mathematical expression, and then pr
    13·1 answer
  • to move from the second cell in the table in the accompanying figure back to the previous cell, press the ____ key(s)
    10·1 answer
  • When using a wireless mouse, what is the most common port used for the transmitter? 
    7·1 answer
  • The city government of Los Angeles recently upgraded its information technology infrastructure​ and, for the first​ time, implem
    14·1 answer
  • Who made the first electronic device?
    14·1 answer
  • What should you do if you forget your root password for MySQL?
    13·1 answer
  • Explain two ways by which the calendar meets or fails to meet the criteria of showing the correct data
    7·1 answer
  • Any computer expert to help me answer this question.. am giving brainliest
    13·1 answer
  • I know I'm asking for a lot. But this is my last question. If we do it I pass my semester. help please.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!