Solved

php object array, python tuple list dictionary

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

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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The viewer will learn how to dynamically set the form action using jQuery.
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…

733 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