Answer to Question #161909 in Python for tamseel

Question #161909
Consider the following lines of Python code.
x = [589,'big',397,'bash']
y = x[2:]
u = x
w = y
w = w[0:]
w[0] = 357
x[2:3] = [487]
1
Expert's answer
2021-02-08T05:09:24-0500

Output of the code line by line will be


x = [589,'big',397,'bash']

y = x[2:]
# output: [397, 'bash']


u = x
# output: [589, 'big', 397, 'bash']


w = y
# output: [397, 'bash']


w = w[0:]
# output: [397, 'bash']


w[0] = 357
# output: 357


x[2:3] = [487]
# output: [487]

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS