(f) Predict the output of the following:
2.
Arr=[1,2,3,4,5,6,1
for i in range(1,6):
arr[i-1]=arr[i]
for i in range(0,4):
print(arr[i], end=" ")
Answers
Answered by
0
Answer:
arr= [1,2,3,4,5,6]
for i in range (1,6):
arr[i-1] = arr[i]
for i in range (0,6):
print(arr[i], end = "")
will give you: 223456233456234456234556234566
Explanation:
With the help of python3 compiler onilne you will get the result. Also, in the old version of python, you mught get a syntax error for end= ""
Similar questions
Science,
3 months ago
Science,
3 months ago
Environmental Sciences,
6 months ago
Computer Science,
11 months ago
Economy,
11 months ago