Functions can be used to replace multiple code statements that perform essentially the same task with different
Fantastic news! We've Found the answer you've been seeking!
Question:
Functions can be used to replace multiple code statements that perform essentially the same task with different values. This occurs in the TicTacToe game program within the tutorial. See the printBoard function created there as an example. Functions often need to switch between doing something based on their input, such as offering different queries to a user. What string method could be used to switch between printing "select a column" and "select a row"?
a
The swapcase method; for example,
colorrow 'column'
printThe must be between and swapcasecolorrow
b
The title method; for example,
colorrow 'column'
printThe must be between and titlecolorrow
c
The index method; for example,
colorrow 'column'
printThe must be between and indexcolorrow
d
The format method; for example,
colorrow 'column'
printThe must be between and formatcolorrow
Related Book For
Posted Date: