28.0k views
1 vote
Put the steps in order to produce the output shown below. Assume the indenting will be correct in the program.

JDoe
1. Line 1
answer = username ('Joann', 'Doe')
2. Line 2
print (answer)
3. Line 3
def username (strFirst, strLast):
4. Line 4
return strFirst[O] + strLast

Put the steps in order to produce the output shown below. Assume the indenting will-example-1
User Amukhachov
by
7.8k points

1 Answer

6 votes

Answer:

The correct code is:

def username (strFirst, strLast):

return strFirst[O] + strLast

answer = username ('Joann', 'Doe')

print (answer)

Step-by-step explanation:

The given code illustrates the use of functions.

i.e passing values to a function and retrieving values from it

So, first: We start with the def statement

def username (strFirst, strLast): ----> This defines the function

Then the return statement

return strFirst[O] + strLast --- > This passes value to the main

Next, is the main function of the program which is:

answer = username ('Joann', 'Doe') ---> This passes values to the username function

print (answer) ---> This prints the returned value from the function

User Anshul Agarwal
by
7.1k points