Questions
Assignment 3-4: IN PYTHON Guest List: If you could invite anyone to dinner, who would you...

Assignment 3-4: IN PYTHON

Guest List: If you could invite anyone to dinner, who would you invite? Make a list that includes at least three people you’d like to invite to dinner. Then use your list to print a message to each person, inviting them to dinner.

---------------------------------------------------------------

Assignment 3-5:

Changing Guest List: You just heard that one of your guests can’t make the dinner, so you need to send out a new set of invitations. You’ll have to think of someone else to invite.

  • Start with your program from Assignment 3-4. Add a print statement at the end of your program stating the name of the guest who can’t make it.
  • Modify your list, replacing the name of the guest who can’t make it with the name of the new person you are inviting.
  • Print a second set of invitation messages, one for each person who is still in your list.

---------------------------------------------------------------

Assignment 3-6:

More Guests: You just found a bigger dinner table, so now more space is available. Think of three more guests to invite to dinner.

  • Start with your program from Assignment 3-4 or Assignment 3-5. Add a print statement to the end of your program informing people that you found a bigger dinner table.
  • Use insert() to add one new guest to the beginning of your list.
  • Use insert() to add one new guest to the middle of your list.
  • Use append() to add one new guest to the end of your list.
  • Print a new set of invitation messages, one for each person in your list.

---------------------------------------------------------------

Assignment 3-7:

Shrinking Guest List: You just found out that your new dinner table won’t arrive in time for the dinner, and you have space for only two guests.

  • Start with your program from Assignment 3-6. Add a new line that prints a message saying that you can invite only two people for dinner.
  • Use pop() to remove guests from your list one at a time until only two names remain in your list. Each time you pop a name from your list, print a message to that person letting them know you’re sorry you can’t invite them to dinner.
  • Print a message to each of the two people still on your list, letting them know they’re still invited.
  • Use del to remove the last two names from your list, so you have an empty list. Print your list to make sure you actually have an empty list at the end of your program.

PreviousNext

In: Computer Science

If you had to make the game of baseball more attractive for viewers and fans, what...

If you had to make the game of baseball more attractive for viewers and fans, what would you do, and what do you think will be the impact?

Case Study V Tracking Industry Changes

In: Finance

Ignore the other questions in answering this one. If the magnetic field is 0.00546 T, the...

Ignore the other questions in answering this one. If the magnetic field is 0.00546 T, the accelerating voltage 150.7 V, and the radius of the electron orbit 0.750 cm, what is e/m from Equation 5?

In: Physics

Read and analyze Prinz v United States (1997) indicating the overarching issue, how the case arose,...

Read and analyze Prinz v United States (1997) indicating the overarching issue, how the case arose, the Supreme Court's decision, and the rationale for that decision. Explain why you agree or disagree with SCOTUS.


In: Economics

According to the NIOSH Lifting Equation, the best case scenario for the RWL if the horizontal...

According to the NIOSH Lifting Equation, the best case scenario for the RWL if the horizontal distance is V=6 inches is …

a. 51 lbs

b. 42 lbs

c. 18 lbs

d. 45 lbs

In: Physics

Conditions are: It is a hard sphere with radius R, it has no resistance. The electrostatic...

Conditions are: It is a hard sphere with radius R, it has no resistance. The electrostatic potential is V. There is a conducting material around it (no boundary) with resistivity, n. Find the electrostatic field, potential and current density outside the sphere.

In: Physics

The electrical conductivity and the electron mobility for copper at room temperature are 6.0 X 107...

The electrical conductivity and the electron mobility for copper at room temperature are 6.0 X 107 (W.m)-1 and 0.003 m2/V-s, respectively. Compute the number of free electrons per copper atom.

In: Mechanical Engineering

A galvanic cell consists of a lead electrode in 0.0256 M Pb(NO3)2 and a aluminum electrode...

A galvanic cell consists of a lead electrode in 0.0256 M Pb(NO3)2 and a aluminum electrode in 0.292 M Al(NO3)3. What is the cell potential (emf, in V) of this cell at 25oC?

In: Chemistry

The volume of a sphere is given by V = 4πr3/3, where r is the radius. Use MATLAB

The volume of a sphere is given by V = 4πr3/3, where r is the radius. Use MATLAB to compute the radius of a sphere having a volume 40 percent greater than that of a sphere of radius 4 ft.

In: Mechanical Engineering

A fluid flow field is given by v = x^2yi + y^2zj-(2xyz + z^2)k. Prove that...

A fluid flow field is given by v = x^2yi + y^2zj-(2xyz + z^2)k. Prove that it is a case of possible steady in compressible flow. Calculate the velocity and acceleration at the point (2,1,3).

In: Mechanical Engineering