---
title: "Discussion on \"Arrays in Python\" | Hashnode"
description: "Discussion on \"Arrays in Python\". Some Array Commands in Python\n# declaring and initializing an array\nmy_array = [1, 2, 3, 4, 5]\n\n# accessing array elements\nprint(my_array[0])  # prints 1\nprint(my_array[2])  # prints 3\n\n# updating array elements\nmy_array[1] = 7\nprint(my_array)  # pri..."
url: "https://hashnode.com/posts/arrays-in-python/6423c45b0a43c356252a7b7a"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Arrays in Python](https://ldfjlja.hashnode.dev/arrays-in-python?utm_source=hashnode&utm_medium=feed)

Some Array Commands in Python # declaring and initializing an array my\_array = \[1, 2, 3, 4, 5\] # accessing array elements print(my\_array\[0\]) # prints 1 print(my\_array\[2\]) # prints 3 # updating array elements my\_array\[1\] = 7 print(my\_array) # pri...

Mar 29, 2023 · 1 min read · ldfjlja.hashnode.dev  
Read the article

-   [#python](https://hashnode.com/tag/python)

## Written by

[Idris idasta](https://hashnode.com/@arttui)

@arttui

  
[View profile](https://hashnode.com/@arttui)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
