Question: Example: Write a one - line Python statement declaring a string storing a campaign slogan. slogan = Guidoin 2 0 2 4 ! ( a

Example: Write a one-line Python statement declaring a string storing a campaign slogan.
slogan = Guidoin2024!
(a)[3 points] Write a one-line Python statement creating and initializing a list of exam grades
containing the numbers 94,77,83, and 91.
(b)[3 points] Use list comprehension to write a one-line Python statement creating and
initializing to all zeros a 1-d array (list) to store daily temperatures for one (non-leap) year.
(c)[3 points] Write a one-line Python statement creating a 2-d array roll (list of lists) that
will be used in a game program to store the results of rolling two dice on each turn and
initializing it to store these three rolls: 1,2 then 3,4 then 5,6.
(d)[3 points] Write one or more Python statements to print out all the values of the temper-
ature list defined in part (b), assuming that it has been populated with non-zero data since
its initialization.
(e)[4 points] Write one or more Python statements to grab the "extension" (i.e., all char-
acters after the last '.') from str variable filename and store the result in the str named
extension. Assume filename contains a '.' and both strings have been created and assigned.
(f)[4 points] Write one or more Python statements to go through a slogan (stored in slogan,
like the one in the Example above) and print "digit" for each character between 0 and 9.
Problem PQ3. Code Analysis. Fill in the values for the lists/variables indicated after the
corresponding code has run.
You must enter your final answers into the boxes provided below to receive credit.
Feel free to use the area outside the boxes for preliminary calculations. Be careful!
(a)
(b) points
Example: Write a one - line Python statement

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 Programming Questions!