Help needed for an Array? Use Cases
I wish to create a blank array of 100 elements
Where blank is either Integer 0 or Empty string ‘“” (two different use cases)
Then I wish to write to specific elements in the array
Either replacing the elements or adding/appending to them
Having read and re read the documents
I have not been able fathom how to accomplish these tasks.
I recall in Algol that this was a trivial task, it was how I ”cheated” doing a sort task,
According to my professor in doing a sort. He wanted a bubble sort.
I simply wrote the numbers into an array where n= array element, and then read them out
How!? In Python?
Is a command missing from the documentation?
a =*100 print(a)
sorted() is your friend... https://docs.python.org/3/howto/sorting.html
OMG why did I try a read the manual, I found a part in the manual that showed me that *100 would not work!?
And yet it all did!
a=*100 print(a) a=1 print(a) a=a+1 print(a) b=['']*100 print(b) b='test' print(b) b=b+'again' print(b)
Btw I wasn’t trying to do a sort that was just a historical side comment, but thanks for the pointer, stored for future reference.