Get The Most Affordable Hosting in the World!
Starting at just $1.87/month, Vercaa offers unbeatable pricing for world-class web hosting services.
Fast, reliable, and secure hosting to power your website without breaking the bank. Plus, enjoy a free CDN for faster loading times worldwide!
Get Started Now!Since the array object behaves very much like a sequence, you can perform indexing and slicing operation with it.
Example
Changing Array Items
You can assign value to an item in the array just as you assign a value to item in a list.
Example
Here, you will get "20" as the output. However, Python doesn't allow assigning value of any other type than the typecode used at the time of creating an array. The following assignment raises TypeError.
It will produce the following output −
TypeError: 'str' object cannot be interpreted as an integer
The End! should you have any inquiries, we encourage you to reach out to the Vercaa Support Center without hesitation.