Solved

php object array, python tuple list dictionary

Posted on 2014-07-20
3
551 Views
Last Modified: 2014-07-22
python has tuple, list, dictionary

php has object and array

I learned php but
I am trying to learn python but I do not understand these variable types


Php is used for websites.
What is python used for?
'Dragon naturally speaking'?
Translators?
0
Comment
Question by:rgb192
3 Comments
 
LVL 109

Assisted Solution

by:Ray Paseur
Ray Paseur earned 250 total points
ID: 40207786
0
 
LVL 16

Accepted Solution

by:
Walter Ritzel earned 250 total points
ID: 40207834
Python can be used for web, windows/linux/macOS scripts, etc... Python is very popular in the data science domain, bioinformatics. It is also used as scripting language for many environments, as Oracle SOA, Websphere, etc...

I strongly advise you to visit: python.org for more detailed information.

Now, in respect to your specific doubt, let me try to clarify: tuples, list and dictionaries are specific types of array. In fact, when comparing to PHP, all those types map against the array type in PHP.

In Python:
Dictionary --> saves pairs of key, value. Keys are unique.
dict = {} #this is how you initialize a dictionary.
key = 'a'
value='tst'
dict[key] = value #this is how you add a key,value to a dictionary

Open in new window


Lists --> this tutorial is good: http://www.tutorialspoint.com/python/python_lists.htm

Tuples --> http://www.tutorialspoint.com/python/python_tuples.htm

From Python website: https://docs.python.org/2/tutorial/datastructures.html

Hope this helps.
0
 

Author Closing Comment

by:rgb192
ID: 40213025
thanks for python explanations and links
Best answer was tuples,lists, dictionary are a specific type of array
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Flask is a microframework for Python based on Werkzeug and Jinja 2. This requires you to have a good understanding of Python 2.7. Lets install Flask! To install Flask you can use a python repository for libraries tool called pip. Download this f…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question