Solved

php object array, python tuple list dictionary

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

Assisted Solution

by:Ray Paseur
Ray Paseur earned 250 total points
Comment Utility
0
 
LVL 15

Accepted Solution

by:
Walter Ritzel earned 250 total points
Comment Utility
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
Comment Utility
thanks for python explanations and links
Best answer was tuples,lists, dictionary are a specific type of array
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Here I am using Python IDLE(GUI) to write a simple program and save it, so that we can just execute it in future. Because when we write any program and exit from Python then program that we have written will be lost. So for not losing our program we…
Strings in Python are the set of characters that, once defined, cannot be changed by any other method like replace. Even if we use the replace method it still does not modify the original string that we use, but just copies the string and then modif…
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …

728 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now