Question: use python3 to write this Q3. Given an array of integers of an arbitrary number of elements, write a program that creates an array with
use python3 to write this
Q3. Given an array of integers of an arbitrary number of elements, write a program that creates an array with the elements "rotated left" according to an integer denoting the shift. For examples: [1, 2, 3] with shift 1 yields [2, 3, 1] [1, 2, 3] with shift 2 yields (3, 1, 2]. [10,20,30,40] with shift 3 yields [40,10,20,30] Hint: the following function called "input" can be used to retrieve a keyboard input from a user. It can be used as follows: userInput = input("Your message to the user") N.B.: userinput is of type String For example: shiftIN = input("What's your shift? ") # To convert the string value saved in the variable shiftIN into an integer, use the built-in function int() as follows: shift=int(shiftin)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
