Hello friends!!!!!

Problem of the day

PYTHON

1 min read

'''

Problem

Having a nested list sometimes might be a bit problematic. An individual

was asked to collect the names of companies in the technology sector.

While creating the list, by mistake the last three companies were subsumed

in a list as shown below. You are required to get rid of the nesting

a)The list of tech companies curated by the individual

tech_companies = ['Qualcomm','Google','Apple',['Nvidia','Cisco','Samsung']]

'''

tech_companies = ['Qualcomm','Google','Apple',['Nvidia','Cisco','Samsung']]

tech_companies = tech_companies[0:3] + tech_companies[3]

print(tech_companies)

Output:

['Qualcomm', 'Google', 'Apple', 'Nvidia', 'Cisco', 'Samsung']