13.07.2020

what was the name of my first dog?

. 4

Faq

Computers and Technology
Step-by-step answer
P Answered by PhD

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!

Computers and Technology
Step-by-step answer
P Answered by PhD

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!

Computers and Technology
Step-by-step answer
P Answered by Specialist

I am writing a Python program.

def phonebook(names, numbers):  #method phonebook that takes two parameters i.e a list of names and a list of phone numbers

   dict={}  #creates a dictionary

   for x in range(len(names)):  # loop through the names

       dict[names[x]]=numbers[x]  #maps each name to its phone number

   return dict #return dictionary in key:value form i.e. name:number

#in order to check the working of this function, provide the names and numbers list and call the function as following:

names = ['Jackie', 'Joshua', 'Marguerite']

numbers = ['404-555-1234', '678-555-5678', '770-555-9012']

print(phonebook(names, numbers))

Explanation:

The program has a function phonebook() that takes two parameters, name which is a list of names and numbers that is a list of phone numbers.

It then creates a dictionary. An empty dictionary is created using curly brackets. A dictionary A dictionary is used here to maps a names (keys) phone numbers (values) in order to create an unordered list of names and corresponding numbers.

for x in range(len(names)):  

The above statement has a for loop and two methods i.e. range() and len()

len method is used to return the length of the names and range method returns sequence of numbers just to iterate as an index and this loops keeps iterating until x exceeds the length of names.

dict[names[x]]=numbers[x]

The above statement maps each name to its phone number by mapping the first name with the first  umber, the second name with the second number and so on. This mapping is done using x which acts like an index here to map first name to first number and so on. For example dict[names[1]]=numbers[1]  will map the name (element) at 1st index of the list to the number (element) at 1st index.

return dict retursn the dictionary and the format of dictionary is key:value where key is the name and value is the corresponding number.

The screenshot of the program and its output is attached.


1 #Write a function called phonebook that takes two lists as

2 #input: 
3 # 
4 # - names, a list of
Computers and Technology
Step-by-step answer
P Answered by Master

I am writing a Python program.

def phonebook(names, numbers):  #method phonebook that takes two parameters i.e a list of names and a list of phone numbers

   dict={}  #creates a dictionary

   for x in range(len(names)):  # loop through the names

       dict[names[x]]=numbers[x]  #maps each name to its phone number

   return dict #return dictionary in key:value form i.e. name:number

#in order to check the working of this function, provide the names and numbers list and call the function as following:

names = ['Jackie', 'Joshua', 'Marguerite']

numbers = ['404-555-1234', '678-555-5678', '770-555-9012']

print(phonebook(names, numbers))

Explanation:

The program has a function phonebook() that takes two parameters, name which is a list of names and numbers that is a list of phone numbers.

It then creates a dictionary. An empty dictionary is created using curly brackets. A dictionary A dictionary is used here to maps a names (keys) phone numbers (values) in order to create an unordered list of names and corresponding numbers.

for x in range(len(names)):  

The above statement has a for loop and two methods i.e. range() and len()

len method is used to return the length of the names and range method returns sequence of numbers just to iterate as an index and this loops keeps iterating until x exceeds the length of names.

dict[names[x]]=numbers[x]

The above statement maps each name to its phone number by mapping the first name with the first  umber, the second name with the second number and so on. This mapping is done using x which acts like an index here to map first name to first number and so on. For example dict[names[1]]=numbers[1]  will map the name (element) at 1st index of the list to the number (element) at 1st index.

return dict retursn the dictionary and the format of dictionary is key:value where key is the name and value is the corresponding number.

The screenshot of the program and its output is attached.


1 #Write a function called phonebook that takes two lists as

2 #input: 
3 # 
4 # - names, a list of
StudenGPT
Step-by-step answer
P Answered by Studen AI
Based on the information provided in the style guide, the correct citation for the book "The Wonders of Digital Art" by Darrell Haynes, Katrina Brown, and Daniel Quartermaine would be:

Darrell Haynes, Katrina Brown, and Daniel Quartermaine. The Wonders of Digital Art. New York: New York College Press, 2018. Print.

In the citation, the first author's name is written in last name, first name format (Haynes, Darrell), followed by the names of the subsequent authors in first name last name format (Katrina Brown, Daniel Quartermaine). The book title is then mentioned, followed by the place of publication (New York), the name of the publisher (New York College Press), the year of publication (2018), and the medium of publication (Print).

The other options provided in the question are not written correctly according to the style guide. The second option incorrectly separates the names of all three authors with commas and includes the phrase "et al." after the first author's name (Haynes, Darrell, Katrina Brown, et al.). The third option simply lists the names of the authors without following the specified format. The fourth option only includes the name of the second author followed by "et al." and does not mention the name of the first or third author (Katrina Brown, et al.).

It's important to note that citation formats can vary depending on the specific style guide being used, so it's always advisable to consult the specific guidelines recommended by your school or institution.
Computers and Technology
Step-by-step answer
P Answered by Specialist

Solution :

$\#$include $$  

$\#$include $$    

void parse$\_$name($char \ full[]$, char first$[],$ char last$[])$

{

// to_get_this_function_working_immediately, _irst

// stub_it_out_as_below._When_you_have_everything_else

// working,_come_back_and_really_parse_full_name

// this always sets first name to "Noah"

int i, j = 0;

for(i = 0; full[i] != ' '; i++)

  first[j++] = full[i];

first[j] = '\0';  

// this always sets last name to "Zark"

j = 0;

strcpy(last, full+i+1);

// replace the above calls with the actual logic to separate

// full into two distinct pieces

}

int main()

{

char full[40], first[20], last[20];

double hours[5];

// ask the user to enter full name

printf("What is your name? ");

gets(full);

// parse the full name into first and last

parse_name(full, first, last);

// load the hours

for(int i = 0; i < 5; i++)

{

   printf("Enter hours for day %d: ", i+1);

   scanf("%lf", &hours[i]);

}

// create the time card

FILE* fp = fopen("timecard.txt", "w");

fprintf(fp, "First Name: %s\n", first);

fprintf(fp, "Last Name: %s\n", last);

double sum = 0.0;

for(int i = 0; i < 5; i++)

{

   fprintf(fp, "Day %i: %.1lf\n", i+1, hours[i]);

   sum += hours[i];

}

fprintf(fp, "Total: %.1f\n", sum);    

printf("Timecard is ready. See timecard.txt\n");

return 0;

}

Computers and Technology
Step-by-step answer
P Answered by PhD

def nametag(first_name, last_name):

return("{} {[0]}.".format(first_name, last_name))

print(nametag("Jane", "Smith"))

# Should display "Jane S."

print(nametag("Francesco", "Rinaldi"))

# Should display "Francesco R."

print(nametag("Jean-Luc", "Grand-Pierre"))

# Should display "Jean-Luc G."

Explanation:

First you must think about that the question ask about the first letter for last_name, remember [0] is the first letter not [1], the other part is about format function and its order


Using Python code.

Fill in the gaps in the nametag function so that it uses the format method to re
Computers and Technology
Step-by-step answer
P Answered by PhD

def nametag(first_name, last_name):

return("{} {[0]}.".format(first_name, last_name))

print(nametag("Jane", "Smith"))

# Should display "Jane S."

print(nametag("Francesco", "Rinaldi"))

# Should display "Francesco R."

print(nametag("Jean-Luc", "Grand-Pierre"))

# Should display "Jean-Luc G."

Explanation:

First you must think about that the question ask about the first letter for last_name, remember [0] is the first letter not [1], the other part is about format function and its order


Using Python code.

Fill in the gaps in the nametag function so that it uses the format method to re

Try asking the Studen AI a question.

It will provide an instant answer!

FREE