Using a for loop, write a function lastfirst() that takes a list of strings as a parameter. Each string in the list has the format 'Last, First' where Last is a last name and First is a first name. You should assume that there are no spaces between the last name and the comma and that there are an arbitrary number of spaces between the comma and the first name. The function lastfirst() returns a list containing two sub lists. The first sub list is a list of all the first names and the second sub list is a list of all the last names. The following shows how the function would be called on two example parameters:>>> lastfirst(['Lulis, Evelyn', 'Jones, Tom', 'Presley, Elvis', 'Sumner, Gordon'])[['Evelyn', 'Tom', 'Elvis', 'Gordon'], ['Lulis', 'Jones', 'Presley', 'Sumner']]>>> lastfirst(['Ford, Harrison', 'Hepburn, Katharine', 'Tracy, Spencer'])[['Harrison', 'Katharine', 'Spencer'], ['Ford', 'Hepburn', 'Tracy']]

Answers

Answer 1

def lastfirst(lst):

   newlst = []

   newlst1=[]

   for x in lst:

       w = x.split(",")

       newlst.append(w[1].strip())

       newlst1.append(w[0].strip())

   newlst2 = [newlst], [newlst1]

   return newlst2

lst1 = (['Lulis, Evelyn', 'Jones, Tom', 'Presley, Elvis', 'Sumner, Gordon'])

print(lastfirst(lst1))

I hope this helps!


Related Questions

Write a function named getResults that accepts radius of a sphere and returns the volume and surface area. Call this function with radius = 3.5 , and display results in one decimal format.
volume = 4/3 * pi * r ^ 3
Surface Area = 4pi * r ^ 2​

Answers

Python

def getResults():

   radius = float(input())

   pi = 3.1415

   volume = 4/3 * pi * radius ** 3

   surfaceArea = 4*pi * radius ** 2.0

   print (volume)

   print (surfaceArea)

getResults()

C#:

       public static void Main(string[] args)

       {

           getResults(Convert.ToDouble(Console.ReadLine()));  

       }

       public static double[] getResults(double radius)

       {

           double radiusObj = radius;

           double volume = 1.33333333333 * Math.PI * Math.Pow(radiusObj, 3);

           double surfaceArea = 4 * Math.PI * Math.Pow(radiusObj, 2) ;

           double[] surfaceAndVolume = { volume, surfaceArea };

           Console.WriteLine(volume.ToString());

           Console.WriteLine(surfaceArea.ToString());

           return surfaceAndVolume;

       }

Java:

public static void main(String[] args)

   {

       Scanner  scanner = new Scanner(System.in);

       getResults(scanner.nextDouble());

   }

   public static double[] getResults(double radius)

   {

       double radiusObj = radius;

       double volume = 1.33333333333 * Math.PI * Math.pow(radiusObj, 3);

       double surfaceArea = 4 * Math.PI * Math.pow(radiusObj, 2) ;

       double[] surfaceAndVolume = { volume, surfaceArea };

       System.out.println(volume);

       System.out.println(surfaceArea);

       return surfaceAndVolume;

   }

When was the information last updated

Answers

Wait what? I don’t understand

meaning of leanness in organization​

Answers

Answer:It is an organizational structure that is designed to create more customer value using fewer resources than a traditional organisational structure

If process P0 is switched to process P1, state for P0 will be saved into ____, and state from ___ will be reloaded.

Answers

Answer:

1. PCB0

2. PCB1

Explanation:

Given that PCB is often referred to as Process Control Block, is a form of data structure that is applicable and utilized by the computer operating systems to store all the information concerning a process.

This process is carried out in a way that when Process P0 is initialized, the operating system established a related process that takes the computer processing unit from Process P0 and allocates it to Process P1, the Operating System, in turn, will save P0's PCB, and then reload P1's PCB.

Hence, If process P0 is switched to process P1, the state for P0 will be saved into "PCB0" and the state from "PCB1" will be reloaded.

Which kind of storage has a spinning platter?

magnetic hard disk

O server

O solid state hard disk

O cloud

Answers

Answer:

Magnetic hard disk

Explanation:

The type of storage that has a spinning platter is called MAGNETIC HARD DISK reason been that MAGNETIC HARD DISK are made up of one or more disks that are been covered with a magnetic coasting or magnetic material to help store information or data permanently on a desktop or a computer and lastly this type of disks help to read data and as well write and rewrite data.

kali linux os and window os who is the best​

Answers

Answer:

Windows

Explanation:

It is down to preference. I prefer windows due to its large compatibility with a wide range of apps.

Answer:

It is only what you prefer

Explanation:

im doing programming with kali and i have no problems. although windows is more user friendly and what people use on a day to day, kali is for pentsters mostly.

A server process in Host B has a welcoming socket at port 977. What will trigger the server process to create a connection socket?

Answers

Answer:

Explanation:

This connection socket will be created when Host B receives a TCP SYN segment that contains the destination port number 977. This means that there is data that is trying to enter through that port number, as a welcoming socket this destination is available and when data requests access through it the OS creates a connection socket using Host B in order to allow access to the TCP SYN segment.

When would it be necessary to edit the information shown on an electronic business card?

Answers

Answer:

It's D dear

Explanation:

Answer:

D. to show only relevant information to people inside your organization

Explanation:

hope this helps :)

Q1 To remove filter

Option1: Click the Filter option of the Sort & Filter button in the Editing group on the HOME

Option2: Click the Filter option in the Sort & Filter group on the DATA tab.

Option3: Both 1 and 2

Option4: Pres DELETE​​

Answers

Answer:

Click DATA, Look for "Sort & Filter", Click Filter Box (right above "Sort & Filter"). Done.

Answer:

add a picture pls

Explanation:

Explain why the expected value of an F ratio is 1.00 when the null hypothesis is true if there is no treatment effect the numerator.

Answers

Answer:

The reason is that the f ratio is balanced due to the numerator and denominator having equal sources of variability.

Explanation:

The expected value of an F ratio is 1.00 when the null hypothesis is true because in a scenario where there is no treatment effect, we have both the numerator and the denominator of the F ratio both measuring equal sources of variability.

Whenever this happens then the F ratio will be balanced and also it will have a value that is near 1.00.

Look at the picture, list down the things you must do to make it more organize​

Answers

Answer:

The electrical cable

Explanation:

The most dangerous is the electrical cable to be organised as much as you can as in case any damage or not double insulation could cause a harm to the people.

jibran has made a presentation on save environment for a competition. his teacher suggested some changes.which view should be using following changes​

Answers

Answer:

Jibran has set up five slides in his new presentation and is ready to enter some text. He wants to focus on entering text without having to think about other PowerPoint elements such as graphics, pictures, sound, and animation. The best method for Jibran to enter text is by using which feature of Microsoft PowerPoint?

Armstrong Numbers Programming challenge description: An Armstrong number is an n-digit number that is equal to the sum of the nth powers of its digits. Determine if the input numbers are Armstrong numbers. Input: Your program should read lines from standard input. Each line has a positive integer. Output: Print out True if the number is an Armstrong number, or False if not. Test 1 Test Input 351 Expected Output False

Answers

Answer:

Written in Python

number = int(input("Enter a number: "))

computesum = 0

lent = len(str(number))

for digit in str(number):

computesum += int(digit)**lent

if number == computesum:

print("true")

else:

print("false")

Explanation:

This line prompts user for Input input

number = int(input("Enter a number: "))

This line initialises the sum of the nth power of the digits to 0

computesum = 0

This line gets the length of input (i.e. number of digits)

lent = len(str(number))

The following iteration iterates through the digit to check for Armstrong numbers

for digit in str(number):

computesum += int(digit)**lent

This checks if the input number equals the computed sum

if number == computesum:

print("true") --- if yes, "true" is printed

else:

print("false") --- if otherwise, "false" is printed

See attachment for complete program in its right format

13 List five examples of functionality that can be added when using express
cards?

Answers

Answer:

This Answer Was Pasted Over From ayushisingh5

Explanation:

ExpressCards can connect a variety of devices to a computer including mobile broadband modems (sometimes called connect cards), IEEE 1394 (FireWire) connectors, USB connectors, Ethernet network ports, Serial ATA storage devices, solid-state drives, external enclosures for desktop-size PCI Express graphics cards and ...

wordList is a list of words that currently contains the values ["tree", "rock", "air"]
Which of the following lines will result in the list containing the values ["air", "rock", "air"]
A. wordList[0] = wordList[2]
B. wordList[2] = wordList[O]
C.insertitem(wordList, O, "air")
D. removeltem(wordList,0)

Answers

Answer:

A. wordList[0] = wordList[2]

Explanation:

Required

Which line would give ["air", "rock", "air"]

From the question, we have that:

wordList =  ["tree", "rock", "air"]

which means that:

wordList[0] = "tree"

wordList[1] = "rock"

wordList[2] = "air"

Analyzing the options.

A. wordList[0] = wordList[2]

This will assign the item in wordList[2] to wordList[0].

and the result would be

So:

wordList[0] = "tree"

would change to

wordList[0] = "air"

The new content of wordList would then be ["air", "rock", "air"]

Option (A) answers the question

The list variable wordList contains three string values, Hence, to obtain the list, ["air", "rock", "air"], the lines wordList[0] = wordList[2] would be used.

List values are indexed from 0 ; hence, tree = index 0 ; rock = index 1 ; air = index 2

To assign the the string "tree" to index 0, then wordList[2] is assigned to wordList[0].

wordList[0] is now "air"

Hence, the required line of code would be wordList[0] = wordList[2]

Learn more :https://brainly.com/question/19117781

What is the purpose of the Microsoft® PowerPoint® application? to design publications such as newsletters and brochures to create documents such as business letters and resumés to develop presentations for business meetings to design a company employee database

Answers

Answer:

The first one

Explanation:

The main purpose of MS PowerPoint is to enable the user to create dynamic, informational slides through the use of text, graphics, and animation.

The purpose of PowerPoint is to act as a visual aid as a presenter goes along presenting their option, ideas, sales pitch, etc. Make sure to not make your slides too wordy and concentrate on adding only basic bullet points.

Answer:

to develop presentations for business meetings

Explanation:

Any of the other options will be used in Word, Excel and Publisher.

But Power Point is mainly for presentations and not newsletters and other.

in the middle of the iteration, how should a team handle requirement changes from the customer

Answers

Answer:

Team may take up the changes in flight after discussing the overall impact with the Product owner

Explanation:

In the middle of the iteration, one of the best ways a team should handle requirement changes from the customer is to take up the changes in flight after discussing the overall impact with the Product owner.

This will make the customer well aware of the advantages and disadvantages that come with changes in the requirement, such that, the customer will be surprised about the final outcome of the iteration.

Right now I have an i5 2400 and a PYN XLR8 gaming GTX 1650 Super, my CPU is too weak for 1080p gaming, what CPU should I get that has a B75 LGA 1155 socket, or Overclock it if so how many GHz should I overclock it to
(I only have a stock cooler)

Answers

Answer:

if its a number you need 5600GHz but im not to sure

Explanation:

Answer:

answer

Explanation:

if it a number you need 5600GHz but it not I'm not sure

A user creates a GPO. What do you need to do for that user to manage his or her GPO that he or she created?

Answers

Answer: Nothing should be done.

Explanation:

Group Policy helps in the provision of a centralized management of operating systems, and applications. It should be noted that a group policy object (GPO) is simply referred to as the configurations involving the group policy.

Nothing should be done to manage the GPO created. When the permission to create a GPO has been given to someone, it means that they can also manage the GPO therefore, nothing needs to be done anymore.

You are troubleshooting an issue where a PC can reach some hosts on the Internet (using either DNS name or IP address), while several other hosts on the Internet are not reachable. From the PC you can Ping all devices on your local subnet. What is most likely causing the problem?

Answers

The options are missing from the question,below are the options to choose from;

A) incorrect (or missing) routes in a routers routing table

B) incorrect DNS configuration on the PC

C) incorrect default gateway configuration on the PC

D) duplicate IP addresses on your LAN

Answer: The correct answer to the question is option A

INCORRECT (OR MISSING) ROUTES IN A ROUTERS ROUTING TABLE.

Explanation: When it is possible for a PC to ping some devices but not actually all,we can then make an assumption that either it has a wrong subnet that is configured or the router from the path to the remote device actually has an incorrect or a missing routes to the device.

what CSS properties will you need for your page

Answers

Answer:

border-radius.

box-shadow.

text-shadow.

text-stroke.

Multiple Backgrounds.

background-size.

text-overflow.

Flexible Box Model.

Explanation:

You need to be familiar with at least some of these kinds of CSS.

Consider a distributed denial of service (DDOS) attack, Assume the attacker has compromised a number of broadband connected computers to use as zombie systems. If the ISP provides a maximum uplink data rate of 512 Kbps in ADSL, what is the maximum number of 512-byte ICMP echo request (ping) packets a single zombie computer can send per second? How many such zombie systems would the attacker need to flood a target server in an organization that has
a. A Fast Ethernet.
b. A Gigabit Ethernet.

Answers

Answer:

A ) 200 Zombie systems

B ) 200 Zombie systems

Explanation:

maximum uplink data rate : 512 kbps = 512 * 1000 * 8  = 4096000 bits/sec

Determine the number of 512 byte  ICMP echo packets = 512 * 8 = 4096 bits

hence the maximum number of 512-byte ICMP echo request (ping) packets a single zombie computer can send per second = 400 packets/sec

i.e. for 512kbps = 400 packets/sec

Determine the number of Zombie systems that the attacker will need to flood a target server

A) For a fast ethernet

A fast ethernet = 100 mbps

The number of Zombie systems needed = 1 zombie system * 200

and 1 zombie system = 512 kbps

therefore for a Fast ethernet the number of zombies systems needed = 200

B) For A Gigabit Ethernet

same as a fast ethernet system i.e. = 200

help plz!!!!!!!!!! neeeeeeeeeeeeeeeeeeeeeeeeeeeeeedddddddddddd heeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeelllllllllppppppppppppppppppppppppppppppppppppppppppppppppppppppp

Answers

Answer:

how to those with other people is so good if you have

Answer:

for what what is your questions

What is the difference between a spreadsheet and word processing software?

Only one can calculate numeric data.
Only one can display graphs and charts.
Only one can organize data.
Only one can present text and numeric data.

Answers

Answer:

Only one can calculate numeric data.

Explanation:

Both spreadsheet and word processing software can display graphs and chats.

Both spreadsheet and word processing software can organize data through cells and tables respectively.

Both spreadsheet and word processing software can present text and numeric data.

Answer:

Only one can calculate numeric data.

Explanation:

uestion
7. If you want to learn how to perform an action, which feature of the Excel window should you use?

A. Quick Access toolbar
B. Tell Me box
C. Status bar
D. File tab

Please help ASAP

Answers

Answer:

B- tell me box

Explanation:

It tells you how to do something you don’t know how to do

What is the main advantage of using a WYSIWYG("what you see is what you get")editor when constructing a website
A.only one programming language is required
B.websites may have more professional construction
C.knowledge of HTML is not required
D.Website templates are not necessary

Answers

Answer:

c

12121212121212121212121212121221212121212121212

In the Allow list box in the Data Validation dialog box,the _____ option means that the cell will accept only times.A) ChronologyB) ClockC) TimeD) Calendar

Answers

Answer:

C) Time

Explanation:

Given that Data validation is a feature in Microsoft Excel in which a user used to specify or determines the type of value or characters that can be typed or entered into a cell.

For example, using data validation to ensure a value of a number is whole numbers, or to ensure character entry is less than 25 characters.

Hence, in this case, the correct answer is the TIME option, will only result in cell accepting only times.

A new version of your operating system is released with several changes made to the transport layer protocols. Specifically, TCP has been removed completely but UDP was not changed. What specific changes must be made to your application to accomodate these changes?

Answers

Answer:

Throughout the description section down, the overview and per the instance.

Explanation:

Throughout terms of communicating and maintaining a link between the application as well as the network, TCP protocols were essential. The program would not be linked or activated if the TCP has indeed been fully disabled. The essential TCP protocol that enables the application to be linked from over network become HTTP as well as HTTPS. Almost all of the significant protocols needed to operate some programs are based primarily on TCP protocols. Besides, as SSH would not operate as a TCP protocol, the OS would not be remotely linked.

Therefore, that would also make it impossible for all the administrators to operate upon this system.

Explain
the three types of periodic
maintanance. .​

Answers

Answer:

poop i think

Explanation:

what is the norm that psychoanalysis of Freud deviates?

Answers

Answer:

Freud deviates from the norm of current mainstream psychology which has more or less lost its way - if it ever had one - under the influence of the same pressures which produce our dysfunctional politics and our troubled societies at large (technological change, globalisation, and so on).

Explanation:

Creds to Quora

Other Questions
How many solutions does this system have? -x + 2y = 16 4x - 8y = -64 QUESTION 11Which of the following is not a type of ethics theory?O DeontologyO UtilatrianismBehaviorismMoral Realitism Read the sentence and choose the correct adjective to best complete the sentence.Los maestros son muy ________. (1 point)cuidadosacuidadosascuidadosocuidadosos A trapezoid. Sides R U and S T are parallel.Examine the trapezoid. Which sides are parallel?sides RU and STsides RS and STsides ST and UTsides RS and UT What is the solution set of the following equation?-8x + x + 15 = -7x + 12 Which number line shows the solution to the inequality 5x + 3> - 17 Washing machines use a large amount of water. A student suggested that old pairs of stained jeans which have to be washed more frequently should be replaced by new pairs of jeans to conserve water. Which of these statements best describes the suggestion made by the student? Question 9 options: It is not practical because an old pair of jeans needs less water to be washed than a new pair of jeans. It is practical because a huge amount of water can be conserved by this method. It is practical because it is easy to implement. It is not practical because it takes a huge amount of water to produce a new pair of jeans. Please help! what is an equation of a parabola with x-intercepts at (2,0) and (-7,0) and which passes through the point (1,32)? Dusky is an adjective that means dark in color. Stretch question: What is the deeper significance behind calling the rivers (Euphrates,Congo,Nile,and Mississippi) dusky? Find the slope for the line that passes thru the points (-2, 7) and (4, 18) que es un experimento determinista Match each historical figure with their ideas about presidency 1. Hamilton2. JeffersonThought citizens could make good decisions for themselves and their country. Believed the country should be led by the voice of citizens. Wanted to promote agriculture Though humans generally could not be trusted. Believe the country should be ruled by education wealthy man. Wanted to promote business manufacturing and trade Which of the following statements representing differences in emotional expressions is not true?Please select the best answer from the choices providedA It is fairly easy to understand the meaning of social gestures due to them being the same across cultures.B Display rules influence what is considered to be appropriate expressions of emotion among different cultures.C Individuals in different cultures differ in how much of their emotions are revealed through personal expressions.D Ways that emotions are categorized in Western cultures are often different from other cultures. Kevin Rogers is interested in buying a five-year bond that pays a coupon of 10 percent on a semiannual basis. The current market rate for similar bonds is 8.8 percent. What should be the current price of this bon?a. $1, 099.b. $982c. $1.048d. $965 Identify the type of figurative language used in the following lines of the poem:Sad as the sea-bird is when, goingForth alonesimilemetonymyallusionconsonancemetaphor 1 There are 4 trucks for every 5 cars in a parking lot. How many trucks andcars could be in the parking lot?A 64 trucks and 80 carsB72 trucks and 73 carsC.84 trucks and 100 carsD.96 trucks and 110 cars Read this passage. It takes place just after Alfonso has promised to take Sandra riding, but hes broken his bike chain. At four he decided to get it over with and started walking to Sandra's house, trudging slowly, as if he were waist-deep in water. Shame colored his face. How could he disappoint his first date? She would probably laugh. Broken Chain, Gary Soto What evidence from the passage supports the theme People often care about what others think of them? Alfonso deciding to go out with Sandra Alfonso worrying that Sandra will laugh Alfonso being angry at himself for blushing NEED ASAP!! 23 POINTS!! Look at the pic above and tell me the velocity, distance and time. Thanks! For which group of people might brain-powered cars allow the greatest increase in mobility?children or young adultspeople with physical disabilitieshighly educated peoplewealthy business people What do you think must be improved from the agrarian reform?