Answered step by step
Verified Expert Solution
Question
1 Approved Answer
################################################################################################################################################################################# PLS ONLY ANSWER 6.2 ######################################################################################################################################################################### QUESTION 1 What kind of statement creates a variable in Python (i.e., what do you need to do to
#################################################################################################################################################################################
PLS ONLY ANSWER 6.2
#########################################################################################################################################################################
QUESTION 1
What kind of statement creates a variable in Python (i.e., what do you need to do to make a new variable exist in your codE)
6.1 (8 pts) In Section 5.2, p. 134-136 the author discusses the "Accumulator Pattem", which is a very important topic in this course; one of the most important for you to master. So please read those two pages several times and try to understand every detail. The figure at the top of p. 135 shows the various stages of execution for the code on p. 134. The code mySum = mySum + num takes the old value of my Sum, adds num to it, and stores the result back in mySum. That code is done inside a for loop, for num in myList, after setting mySum initially to zero. The final value for my Sum is 20. Page 2 of 6 CS 8 (Winter 2020) Re-write this code to iterate through the numbers in numList and add them to mySum using a while loop. numList - (3, 2, 7, -1, 9] mySum=i=0 while iStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started