Blog Introductions
In this blog contains tutorials about HTML Tutorials, Python Tutorials, CSS Tutorials, How to, PHP Tutorials, Java Tutorials, C++ Tutorials, Tutorials, Examples, Source code,Learning,
Tips and Software development services. Python Arrays and its functions | Python tutorials Bestitworriors
In this blog contains tutorials about HTML Tutorials, Python Tutorials, CSS Tutorials, How to, PHP Tutorials, Java Tutorials, C++ Tutorials, Tutorials, Examples, Source code,Learning,
Tips and Software development services. Python Arrays and its functions | Python tutorials Bestitworriors
Python Arrays and its functions
Python Arrays and its functions | Python tutorials Bestitworriors - Arrays use to hold multiple values in one array variable.Arrays are use to hold same type of multiple values in one variable. If we need to hold Ten values we need to declare Ten variables for this problem we require time and space and number of line of code more.To Overcome this problem we use array to hold multiple values in one variable. It take less time less space and less number lines of codes.
Some Key Points of Python Array
- Array hold multipule values in one variable
- Array is simple and short to write code in array rather then writing multiple variables
- You can loop through array values
- Array Save Time and Lines of Code
- You can perform multiple operation to array values like sort , add new value and delete any value or accecs arrys value
- You can get length of array using len() function
Code
Months = ["January", "Feburary", "March", "April", "May", "June", "Jully"]
x = Months[0]
print(x)
Months[0] = "December"
Months.append("November")
length = len(Months)
print(length)
Months.pop(1)
for x in Months:
print(x)
#Removing array
OutPut
January
8
December
March
April
May
June
Jully
November
8
December
March
April
May
June
Jully
November
0 Comments