64.4k views
1 vote
Given variables first and last, each of which is associated with a str, representing a first and a last name, respectively. Write an expression whose value is a str that is a full name of the form "Last, First". So, if first were associated with "alan" and last with "turing", then your expression would be "Turing,Alan". (Note the capitalization! Note: no spaces!) And if first and last were "Florean" and "fortescue" respectively, then your expression's value would be "Fortescue,Florean".

User Retronym
by
5.9k points

1 Answer

5 votes

Answer:

The python code is attached

Step-by-step explanation:

  1. I defined a function called Fullname
  2. The function accepts 2 parameters first and last
  3. last[0] gives the first letter of the last variable
  4. last[0].upper() modifies the first letter as upper letter
  5. same applied to variable first
  6. + sign concatenates strings and variables to the variable name
  7. the function returns the variable name

Given variables first and last, each of which is associated with a str, representing-example-1
User Ideaboxer
by
5.9k points