Write and demonstrate a Lambda function named stg() that appends .txt to its argument. What happens when you call the function with an integer?
What will be an ideal response?
>>> stg = lambda b: b + '.txt'
>>> stg('aaa')
'aaa.txt'
When called with an integer, the function returns an error when it tries to
catenate an integer and a string:
TypeError: unsupported operand type(s) for +: 'int' and 'str'
You might also like to view...
Answer the following statements true (T) or false (F)
1. The orientation of a smartphone or tablet is important and designers should program apps for both portrait and landscape modes. 2. The smartphone market and tablet markets are constantly evolving. New operating systems will change the way apps are designed in the future. 3. An executive can find a dashboard to be extremely useful in making decisions, but only if the dashboard is designed properly. 4. An executive uses a dashboard to review individual transactions to see how a company is performing.
This statement:
``` preg_match("/\b(car[[:alpha:]]+)\b/i", $string) ``` a. searches for any word beginning with the pattern "car" b. searches for any word ending with the pattern "car" c. searches specifically for the whole word "car" d. searches for any lowercase string that matches the pattern "car"