Question

In: Computer Science

1) Use Python to answer the below questions. a) What is the output of the following...

1) Use Python to answer the below questions.

a) What is the output of the following python code?

                        def function(x):
                             return x * 5
                       print(func(7) * func(5))

b) What is the output of the following code fragment?
    required_course = "Programming", "Security", "Cybersecurity"
        a,b,c = required_course
        print(b)

Solutions

Expert Solution

ANSWER 1 : Output is 875

#CREATING A FUNCTION NAMED AS func
def func(x):
    #MULTIPLYING VALUE OF X INTO 5
    return x*5
#PASSING THE VALUE OF X ONE BY ONE TO THE FUNCTION func AND THEN
#FINALLY PRINTING THE FINAL VALUE OF X
print((func(7)*func(5)))

Output :

WORKING :

7*5=35

5*5=25

35*25=875

ANSWER 2 : Output is "Security".

#Adding 3 string into a variable 
required_course = "Programming", "Security", "Cybersecurity"
#adding the values of required_course into
#new variables a, b and c
a,b,c = required_course
# Printing the value of b variable 
print(b)

Output :

WORKING :

required_course = "Programming", "Security", "Cybersecurity"

a= "Programming"

b= "Security"

c= "Cybersecurity"

print(b)

O/P = Security


Related Solutions

Use the output below to answer the following questions regarding the association between carbon dioxide levels...
Use the output below to answer the following questions regarding the association between carbon dioxide levels and amount of coal used. Estimate Std. Error. t value.   P r(> |t| Intercept 6.166678. 2.171695.    2.84   0.00571 Coal 0.030171. 0.002976   10.14.   4.52e-16 -Create a 98% estimate for the independent variable. - Is the explanatory variable significant at α = 0.01? - Suppose the correlation is 0.7478824. Determine the value of the coefficient of determination and explain what this value represents. - What...
Use the table below to answer the following two questions: Units of output Total fixed cost...
Use the table below to answer the following two questions: Units of output Total fixed cost Total variable cost 1 150 50, 2 150 96, 3 150 140, 4 150 180 1) What is the marginal cost of producing the third unit of output? a) $20 b) $44 c) $70 d) this cannot be determined from the data 2) At which unit of production do diminishing returns become evident? a) 1 b) 2 c) 3 d) 4 3) Accounting costs...
Use the following information to answer the questions below:
Use the following information to answer the questions below: note: all sales are credit sales Income Stmt info: 2016 2017 Sales $ 975,000 $        1,072,500 less Cost of Goods Sold: 325,000 346,125 Gross Profit 650,000 726,375 Operating Expenses 575,000 609,500 Earnings before Interest & Taxes 75,000 116,875 Interest exp 25,000 31,000 earnings before Taxes 50,000 85,875 Taxes 20,000 34,350 Net Income $ 30,000 $              51,525 Balance Sheet info: 12/31/2016 12/31/2017 Cash 60,000 $ 63,600 Accounts Receivable 80,000 $ 84,000 Inventory...
Use the following data to answer the questions below:
Use the following data to answer the questions below:             Q                 VC             MC           AVC              1                 $10              ___            ___                                   2                16              ___            ___                       3                20              ___            ___                                   4                25              ___            ___              5                31              ___            ___              6                  38              ___            ___                  7                  46              ___            ___8                  55              ___            ___9                  65              ___            ___         a. Calculate the marginal cost and average variable cost for each level of production.b. How much would the firm produce if it could sell its product for...
1. Use the information below to answer the following questions. The following units of an inventory...
1. Use the information below to answer the following questions. The following units of an inventory item were available for sale during the year: Beginning inventory 10 units at $55 First purchase 25 units at $60 Second purchase 30 units at $65 Third purchase 15 units at $70 The firm uses the periodic inventory system. During the year, 60 units of the item were sold. a. Calculate the value of ending inventory using FIFO. b. Calculate the value of ending...
Use the Following Information to Answer the Questions Below to prepare the Bank Reconciliation 1) If...
Use the Following Information to Answer the Questions Below to prepare the Bank Reconciliation 1) If Any Differences or Errors are found, Assume that Our Business made the mistake and the BANK records are accurate. 2) The Following Items were Included on the Bank Statement from the Schwab Bank for the Month as Follows; Ending Bank Balance at January 31 was $69,000. Monthly Bank Fees of $1,500 NSF Check from Customer H.Clinton for $11,000 Interest Earned During the month was...
1.) Use the given information below to answer the following questions. a.) A sample of 25...
1.) Use the given information below to answer the following questions. a.) A sample of 25 lightbulbs was taken and it was found that the mean lifetime of a certain bulb for a movie projector is 520 hours with a standard deviation of 50 hours. The standing assumption of the manufacturing company is that the lifetime of this type pf bulb is no more than 500 hours. Assume a normal distribution. Does the data support the company’s claim at a...
Use the table below to answer the questions below. The following prices are for call and...
Use the table below to answer the questions below. The following prices are for call and put options on a stock priced at $50.25. The March options have 90 days remaining and the June options have 180 days remaining. In your profit answers below, assume that each transaction is scaled by 100, reflecting the size of option contracts. Calls Puts Strike March June March June 45 6.85 8.45 1.20 2.15 50 3.90 5.60 3.15 4.20 55 1.95 3.60 6.15 7.00...
Use Minitab and produce the appropriate output to answer the following questions. Attach or include the...
Use Minitab and produce the appropriate output to answer the following questions. Attach or include the relevant Minitab output. Construct a scatter plot. Recalling what scatter plots are used for, write a couple of sentences addressing what you observed from the plot. Be sure to relate your observations to the purpose of using scatter plots in regression. (4 points) Can we conclude that median family income helps in predicting median home price? Follow the 7 steps for hypothesis testing. (10...
Please answer all the questions. Thank you Use the following data to answer the questions below:...
Please answer all the questions. Thank you Use the following data to answer the questions below: Column 1 Column 2 Column 3 Y in $ C in $ 0 500 500 850 1,000 1,200 1,500 1,550 2,000 1,900 2,500 2,250 3,000 2,600 What is mpc and mps? Compute mpc and mps. Assume investment equals $ 100, government spending equals $ 75, exports equal $ 50 and imports equal $ 35. Compute the aggregate expenditure in column 3. Draw a graph...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT