hi guys
wat if List is equivalent 2 Arrays in c
or do we have Arrays seperately defined in python??
karthik.c 6 Light Poster
Recommended Answers
Jump to PostOh yes, Python has an array type, but you must import module array:
# module array has Python's array type import array # Python25 use 'c' as the character typecode # Python30 uses unicode character typecode 'u' char_array = array.array('c', 'hello world') print(char_array[0]) # h print(char_array) # …
Jump to PostOne more thought: lists of lists in Python function reasonably well as arrays:
mylist = [[1,2,3],[4,5,6],[7,8,9]] print mylist[0][2] 3
I say "reasonably well" -- there aren't any linear algebra methods that can be used on lists of lists (like det(), inv(), or eigenvalues()), but the LinearAlgebra module …
All 5 Replies
scru 909 Posting Virtuoso Featured Poster
Ene Uran 638 Posting Virtuoso
scru commented: You knowledge of Python is astounding +5
scru 909 Posting Virtuoso Featured Poster
jrcagle 77 Practically a Master Poster
karthik.c 6 Light Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.