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
murzikaleks [220]
3 years ago
11

#Write a function called alter_list. alter_list should have#two parameters: a list of strings and a list of integers.##The list

of integers will represent indices for the list of#strings. alter_list should alter the capitalization of all#the words at the designated indices. If the word was all#capitals, it should become all lower case. If it was all#lower case, it should become all capitals. You may assume#that the words will already be all-caps or all-lower case.##For example:## string_list = ["hello", "WORLD", "HOW", "are", "you"]# index_list = [0, 2]# alter_list(string_list, index_list) -> # ["HELLO", "WORLD", "how", "are", "you"]##After calling alter_list, the strings at indices 0 and 2#have switched their capitalization. ##Note that it may be the case that the same index is present#in the second twice. If this happens, you should switch the#text at that index twice. For example:## string_list = ["hello", "WORLD", "HOW", "are", "you"]# index_list = [0, 2, 2]# alter_list(string_list, index_list) -> # ["HELLO", "WORLD", "HOW", "are", "you"]##2 is in index_list twice, so the string at index 2 is#switched twice: capitals to lower case, then back to#capitals.#Write your function here!#Below are some lines of code that will test your function.#You can change the value of the variable(s) to test your#function with different inputs.##If your function works correctly, this will originally#print:#["hello", "WORLD", "HOW", "are", "you"]#["HELLO", "WORLD", "HOW", "are", "you"]print(alter_list(["hello", "WORLD", "HOW", "are", "you"], [0, 2]))print(alter_list(["hello", "WORLD", "HOW", "are", "you"], [0, 2, 2]))
Computers and Technology
1 answer:
Aleks04 [339]3 years ago
7 0

Answer:

The Python code is given below with appropriate comments

Explanation:

def alter_list(strings,index):

   

   for i in index:

       s = strings[i]

       if s.islower():  #checking if lowercase

           strings[i] = s.upper()  #assigning variable in strings to uppercase in s

           

       if s.isupper():  #checking if uppercase

           strings[i] = s.lower()  #assigning variable in strings to lowercase in s

   return strings  #returns strings for the function

           

print(alter_list(["hello", "WORLD", "HOW", "are", "you"], [0, 2]))

print(alter_list(["hello", "WORLD", "HOW", "are", "you"], [0, 2, 2]))

You might be interested in
​A(n) ____ statement can include rules for site visitors, a statement of copyright in the site design and content, and can restr
laiz [17]

Answer: TOS

Explanation:

 Terms of service is the agreement and the set of rules and regulations for the site visitors. It include all the terms and condition or the disclaimer when addressing the particular website.

Terms of service are set before designing the any type of the site and content in the system that restrict all the types of business that the users conduct in the site.

7 0
2 years ago
What are impacts of ict in every day your life?describe if prifely​
telo118 [61]

Answer:

ICT is a broad subject and a concept of evolving.It covers any product that will store, retrieve, manipulate, transmit, or receive information electronically in a digital form.

Explanation:

HOW WE USE ICT IN OUR DAILY LIFE

COMMUNICATION

JOB OPPORTUNITIES

EDUCATION

SOCIALIZING

POSITIVE IMPACT OF ICT IN OUR DAILY LIFE

1.Easy to access information:

I use ICT to access more information that I need for everyday schooling.Because Internet has more faster than searching to a school library. Even the deadline of my research is coming, I can make it fast with the help of ICT

2. Education: distance learning and on-line tutorials. New ways of learning, e.g. interactive multi-media and virtual reality.

3.Free access of sharing like photo,video,and message

5 0
2 years ago
Jensen is a senior developer for Hackers R'Us, a company that helps secure management information systems. Jensen's new task is
Harlamova29_29 [7]

Answer:

b. white-hat hacker

Explanation:

A White-hat Hacker, also known as an Ethical Hacker is an information security specialist, known for performing penetration testing and checks in search for information and communications system's vulnerabilities on demand for his/her clients.

These efforts are meant to find security risks before someone else does, who could cause any kind of damage to the systems or unauthorized access to sensitive information

6 0
3 years ago
PC’s & More has shifted to sales and service of laptops and PCs, where it has the potential to triple the number of its cust
photoshop1234 [79]

Answer:

Growth Strategy

Explanation:

A growth strategy is a plan of action that allows you to achieve a higher level of market share than you currently have. Such as the case in the question, PC's shifted so sales and service of Laptops and PCs because there is a greater market share for them there than where they currently operate from.

5 0
3 years ago
Assume that a single page of printed text requires 52 lines of text, and that each line of text averaged 80 characters. If each
zysi [14]

Answer:

4160000 bytes

Explanation:

One page = 52 lines of text

One line of text = 80 characters

=> One page = 80 x 52 = 4160 characters

Therefore, 500 pages of text will have 4160 x 500 characters = 2080000 characters.

Since 1 character takes up 2 bytes of computer memory, it impleies that a 500 page novel will take up 2080000 x 2 bytes = 4160000 bytes.

5 0
3 years ago
Other questions:
  • In which file format is image data compiled into a binary file? TIFF SVG CGM BMP
    11·1 answer
  • A biologic reaction is produced by 4 Gyt of a test radiation. It takes 16 Gyt of 250-kVp x-rays to produce the same biologic rea
    11·1 answer
  • The piece of hardware that contains the circuitry that processes the information coming into the computer and tells the other ha
    6·1 answer
  • Write a parent program to fork(2) n processes where n is passed tothe program on the command line, and n can be from 1 to 10. Al
    12·1 answer
  • What are minimum computer requirements for a software program?
    5·1 answer
  • Will give brainly if answer all or my questions
    8·1 answer
  • which of the following devices and and receive information from other device? a parallel port B serial port C video port d both
    8·1 answer
  • "En la opción
    10·1 answer
  • Mavis is considering signing up for a hosted enterprise software solution for her small business. She recognizes that an advanta
    15·1 answer
  • You work part-time at a computer repair store. You're building a new computer. The customer has requested two serial ATA (SATA)
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!