356,475 views
27 votes
27 votes
The part of the program where strFirst can be used or changed describes its

def username (strFirst, strLast):
return strFirst[0] + strLast
def username (strFirst, strLast):
return strFirst + strLast[0]
answer = username (Joann', 'Doe')
print (answer)
O value
Oneighborhood
Oscope
assignment

User Matthias Baetens
by
2.6k points

1 Answer

16 votes
16 votes

Answer:

Scope

Step-by-step explanation:

Variables can only be used inside the scope they are created in. The exception is global variables, which can be used anywhere.

You can use a variable in a function, but you have to pass it in through the method header:

var testVariable;

function DoSomething( var testVariable ) {

//testVariable can now be used in here as a copy

}

User Cryptc
by
2.7k points