Question: Try the following problem #6 Remember that different types behave differently in Python. For example, when you sub two strings together you will got a

 Try the following problem \#6 Remember that different types behave differently
in Python. For example, when you sub two strings together you will

Try the following problem \#6 Remember that different types behave differently in Python. For example, when you sub two strings together you will got a ditterent behavior than when your sum to integers. - Calculate the product of savings and growth multiplier and store the result in a new variable caled yeart. - The value of savings and growth multiplier come from your previous solutions. - What do you think the resulting type will be? Find out by printing the type of year1. - Calcuiate the sum of savings type and savings_type and store the result in a new variable called double save. - Print out double save. Did you oxpect this? Try the following problem 17 Use the + oparator to paste two strngs togothec Suppose you want to summarite the nesuts of your investment with a string of tert: Assuming you have detined savings and result betore. nnent(I started win' + stivings + ' and now have ' + reseft + '? ? Ahhough this might not seem the it will you, you will heceive an error because you connot sum strings and Aloats or integers. Alowever. you can fix this by comvering savings and resuit to sting variables with the stro command, similir to what we did above. For example, you can cogivert savings to a string with str(savings) Simal functions include int0. fioat0. and beole. - Create the varabie monthly savings as a string (ie. 125) ma then set is equai to a foat and sore this as a now variaclio monthly, savings thost. Lists can contain varlables that reference other values as well. Create a list of lists with the following stocks and their prices. - Coenpary ABC - Company BBB - Comany ZYZ - Compary CCC - Compary RST - Rather than putting the price of esch stock directy into the list, create a new set of variables with stock price. - ABC=11.25 * BPA =18.0 - YZ=20.0 - CCC =10.75 - RST = 9.50 - Print your new list. Don't get contused: 'Company ABC ' is a string and ABC is a variable that represents the Compary ABC or 1125. Try the following problem t 9 Let us return to our compary hames and prices. I have recreated the lint below calad stock. - Prit out the second element from the stock list. - Subset and print out the last elernent of the stock list using negative indexing. - Seiect the rumbet representing the price of the ZYZ and print it oif

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!