Question: Python pycharm B = (3.5, 3.7, 5.0, 10.6, 25.3, 50.6) What is wrong with: B[3] = 10.6 ? Write output for: print('Slice sum = {mySum:06.2f}'.format(mySum=sum(B[-3:1:-1])))

Python pycharm

B = (3.5, 3.7, 5.0, 10.6, 25.3, 50.6)

  1. What is wrong with: B[3] = 10.6 ?
  2. Write output for:

print('Slice sum = {mySum:06.2f}'.format(mySum=sum(B[-3:1:-1])))

  1. Write an equivalent line of code to the above print statement using all positive numbers for slicing.
  2. Is a, b, c = B[-1:-5:-1] allowed?
  3. If d. is allowed, what is the value of b? If d. is not allowed, correct the statement (by changing only one character) and tell the value of b.

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!