Actions

  Print Article
  BookMark Article

Categories    Category List

Arts & Humanities
  Books & Authors
  Dancing
  Genealogy
  History
  Performing Arts
  Philosophy
  Poetry
  Theater & Acting
  Visual Arts
Beauty & Style
  Fashion & Accessories
  Hair
  Makeup
  Skin & Body
Business & Finance
  Advertising & Marketing
  Careers & Employment
  Corporations
  Credit
  Insurance
  Investing
  Personal Finance
  Renting & Real Estate
  Small Business
  Taxes
Cars & Transportation
  Aircraft
  Boats & Boating
  Car
  Insurance & Registration
  Maintenance & Repairs
  Motorcycles
  Rail
Computers & Internet
  Computer Networking
  Hardware
  Internet
  Programming & Design
  Security
  Software
Consumer Electronics
  Camcorders
  Cameras
  Cell Phones & Plans
  Games & Gear
  Home Theater
  Music & Music Players
  PDAs & Handhelds
  TVs
Dining Out
Education & Reference
  Financial Aid
  Higher Education
  Preschool
  Primary & Secondary Education
  Special Education
  Studying Abroad
  Teaching
Entertainment & Music
  Celebrities
  Comics & Animation
  Horoscopes
  Jokes & Riddles
  Magazines
  Movies
  Music
  Polls & Surveys
  Radio
  Television
Environment
  Alternative Fuel Vehicles
  Conservation
  Global Warming
  Green Living
Family & Relationships
  Family
  Friends
  Marriage & Divorce
  Singles & Dating
  Weddings
Food & Drink
  Beer, Wine & Spirits
  Cooking & Recipes
  Ethnic Cuisine
  Vegetarian & Vegan
Games & Recreation
  Amusement Parks
  Board Games
  Card Games
  Gambling
  Hobbies & Crafts
  Toys
  Video & Online Games
Health
  Alternative Medicine
  Dental
  Diet & Fitness
  Diseases & Conditions
  General Health Care
  Men's Health
  Mental Health
  Optical
  Women's Health
Home & Garden
  Cleaning & Laundry
  Decorating & Remodeling
  Do It Yourself (DIY)
  Garden & Landscape
  Maintenance & Repairs
Local Businesses
News & Events
  Current Events
  Media & Journalism
Pets
Politics & Government
  Civic Participation
  Elections
  Embassies & Consulates
  Government
  Immigration
  International Organizations
  Law & Ethics
  Military
  Politics
Pregnancy & Parenting
  Adolescent
  Adoption
  Baby Names
  Newborn & Baby
  Parenting
  Pregnancy
  Toddler & Preschooler
  Trying to Conceive
Science & Mathematics
  Agriculture
  Astronomy & Space
  Biology
  Botany
  Chemistry
  Earth Sciences & Geology
  Engineering
  Geography
  Mathematics
  Medicine
  Physics
  Weather
  Zoology
Social Science
  Anthropology
  Dream Interpretation
  Economics
  Gender Studies
  Psychology
  Sociology
Society & Culture
  Community Service
  Cultures & Groups
  Etiquette
  Holidays
  Languages
  Mythology & Folklore
  Religion & Spirituality
  Royalty
Sports
Travel

Online Now    Online Now

Author Login    Author Login

Welcome Guest! Please login or create an account.

Username:

Password:



Navigation    Navigation

ADS    Featured Author

ad

ADSDisclosure

what is Pythons equivalent of an array called?

Author :

Submitted : 2018-06-15 14:59:39    Popularity:     

Tags: equivalent  Pythons  called  array  

Python has arrays, but you'll more commonly use lists or dictionaries. The closest Python types to arrays from other languages are either lists or tupl

Answers:

Python has arrays, but you'll more commonly use lists or dictionaries.

The closest Python types to arrays from other languages are either lists or tuples. Tuples are immutable sequences that you can't change, so lists are more often used.

a = [1, 2, "three", 4.0, '5'] # a list with five elements
b = (1, 2, "three", 4.0, '5') # a tuple with five elements

Both can be accessed with [] indexing, with both a[2] and b[2] being "three".

Both can be extended with the += operator; but lists will be extended in-place, while the tuple version creates a new tuple.

a += [77] # appends a 77 to list a
b += (77,) # creates a new tuple with 77 appended to the old b tuple

Note the syntax in that last line. (77) is just the number 77, so the special syntax (77,) is needed to create a tuple with just one element.

If at some point you want to really learn the Python language for its own sweet self, rather than either as a tool for prototyping programs to be written in other languages, or an intro-to-programming language, I can recommend:
"Core Python Programming" by Wesley Chun
"Beginning Python [from Novice to Professional]" by Magnus Lie Hetland

Both of those are good books on Python with lots of useful examples.

Just an array.

That would be a list.



Good
Back Homepage
Back


Article Source:
www.Aphotolog.Com

Answer Questions