Solved

php object array, python tuple list dictionary

Posted on 2014-07-20
3
535 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Sequence is something that used to store data in it in very simple words. Let us just create a list first. To create a list first of all we need to give a name to our list which I have taken as “COURSE” followed by equals sign and finally enclosed …
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…

785 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