Make a condition that should print Yes, it is 5 if the value of my_var is...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Make a condition that should print "Yes, it is 5" if the value of my_var is 5 and "No, it is not 5" if it is not. my_var = 5 Print all the items which start with a. If it does not start with a, print "not starting with a" items = ['abby', 'argh', 'stuff, 'whoa', 'yes', 'away', 'boo', 'a', 'the'] Find the sum of items that are under 10 on the list. list = [1, 15, 10, 8, 5, 56] Make a condition that should print "Yes, it is 5" if the value of my_var is 5 and "No, it is not 5" if it is not. my_var = 5 Print all the items which start with a. If it does not start with a, print "not starting with a" items = ['abby', 'argh', 'stuff, 'whoa', 'yes', 'away', 'boo', 'a', 'the'] Find the sum of items that are under 10 on the list. list = [1, 15, 10, 8, 5, 56]
Expert Answer:
Answer rating: 100% (QA)
You can achieve this using conditional statements and loops in Python Heres the code ... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
A Ltd. obtained from B. S. Ltd. a lease of some coal bearing land, the terms being a royalty of ~ 15 per ton of coal raised subject to minimum rent of ~ 75,000 per annum with a right of recoupment of...
-
A bakery with a December 31 st year end purchased new equipment on October 31 st 2000 for $10,000. This was their first equipment purchase. Required: What are the tax consequences if the equipment is...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
THE iterative software development method. Just read the case thoroughly and answer the below-mentioned 3 questions. Here are the three questions to be answered: 1. What are the two choices Lalonde...
-
Explain the difference between the voting-interest model and the risk-and-reward model used for consolidation.
-
Liquid water is pumped from 100 kPa to 600 kPa at a flow rate of 1.2 m3 /s. Calculate the necessary input power to the pump.
-
You jump into the air from a level floor. Which of the following are exerting a force on you: (a) the floor, (b) the Earth, (c) the air, (d) your feet?
-
1. Consider an accounting firm with two accountants. a. Fill in the blanks in the following table. b. Quigley has a comparative advantage in_____________, while Slokum has a comparative advantage...
-
6. 7. 8. If one of the diameters of the circle x + y-2x-6y+6=0 is a chord of another circle 'C', whose centre is at (2, 1), then its radius is Let Bi (i = 1, 2, 3) be three independent events in a...
-
Using Exhibit 1.3 as a model, describe the source- make- deliver-return relationships in the following systems: From Exhibit 1.3 a. An airline b. An automobile manufacturer c. A hospital d. An...
-
Growth prospects for SA's trading partners, such as Europe, are slowly picking up momentum and improved Eurozone growth could benefit SA's economy Use the AS_AD model to explain and illustrate the...
-
In the Statement of Revenues, Expenditures, and Changes in Fund Balances, transfers must be reported a. in a separate section immediately following revenues. b. in a section immediately following the...
-
The following GAAP requirements for budgetary reporting are true except a. budgetary comparisons for the General Fund and major Special Revenue Funds must include expenditure data that is at least as...
-
Which of the following statements would be true concerning budgetary integration? a. The integration of budgetary accounts into the general ledger does not affect the asset and liability accounts. b....
-
The budget data presented in a school district General Fund statement of revenues, expenditures, and changes in fund balancesbudget and actualare to be a. the original, legally adopted budget. b. the...
-
Which of the following items does a government with a modified accrual and encumbrances basis budget report differently in its budgetary basis statement of revenues, expenditures, and changes in fund...
-
Persuasive Messages. Magazine Ad Format. Check FormatInformation. 1. You are an EXTREME GAMING enthusiast having wonseveral awards and a great amount of money in the gaming field.Your fame is well...
-
What types of inventory issues Starbucks might reflect upon at the end of each year? The mission of Starbucks is to inspire and nurture the human spiritone person, one cup, and one neighborhood at a...
-
The following additional information is available for the Dr. Ivan and Irene Incisor family. Ivan and Irene have the following investment income, in addition to that reported in Chapter 1: Dividends...
-
William sold Section 1245 property for $25,000 in 2012. The property cost $35,000 when it was purchased 5 years ago. The depreciation claimed on the property was $16,000. a. Calculate the adjusted...
-
Jim is fired from his job as a waiter and decides to take an extended trip to Europe. After touring Europe for 3 months, Jim returns to look for a new job as a waiter. Are his job-hunting expenses...
-
True or False: When dealing with multiple alternatives having unequal lives, the planning horizon equals the least common multiple of lives.
-
Given the following information about sources of capital, what is the appropriate weighted average cost of capital to use in determining MARR? a. 9.87 percent b. 10.55 percent c. 12.42 percent d....
-
When using the "shortest life" planning horizon, what issue should you explicitly consider for alternatives whose cash flow profiles extend longer than the "shortest life"'? a. Determination of...
Study smarter with the SolutionInn App