Question: Thonny Coding. # Question 1: # Create a list using List Comprehension. # assign it to a variable. # this list should have a random
Thonny Coding.

# Question 1: # Create a list using List Comprehension. # assign it to a variable. # this list should have a random length: ##### -> using range() in your List Comprehension -> random.randInt() to get a random number between 5 and 100 the random number you get form randInt should be the input into your range() # random length means that everytime the code is executed, a new # length is determined. # Resources: -> https://docs.python.org/3/library/random.html -> https://www.geeksforgeeks.org/python-list-comprehension/ # Question 2: # Using a For loop, iterate through each item in the list you created # above, and print out the following string.... # "The value is at position " # at the end of the for loop, you should print the following line: # "List Iteration Completed." # Question 3: # Given the following variable string_example = "abcdefghijklmnop" # create a list in which each element is a single character from the # string above. Use List comprehension, and remember that string_example # is just another sequence. Assign this list to a variable.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
