+ 1

What is the tuples?

please help me

31st Dec 2017, 6:57 PM
Mostafa Haghiri
Mostafa Haghiri - avatar
6 odpowiedzi
+ 12
A tuple is a sequence of immutable Python objects. Tuples are sequences, just like lists. The differences between tuples and lists are, the tuples cannot be changed unlike lists and tuples use parentheses, whereas lists use square brackets. https://www.tutorialspoint.com/python/python_tuples.htm Tuples are very similar to lists, except that they are immutable (they cannot be changed). Also, they are created using parentheses, rather than square brackets. https://www.sololearn.com/learn/Python/2452/
31st Dec 2017, 7:17 PM
Koketso Dithipe
Koketso Dithipe - avatar
+ 2
Tuples are Python sequences like strings, they are immutable objects meaning cannot be changed once created. Unlike strings, which can contain only characters, tuples can contain elements of any type. Tuples use parentheses eg (Tiger, Coffee, 1, 'a', 10.50, b) Strings use quotes eg 'Hello', "Hello", '"Hello"' Lists are the 3rd type of sequence although you didn't ask about it. I assume you have to know about them also. List are mutable - use brackets eg [Tiger, coffee, 1, 'a', 10.50, 'b']
31st Dec 2017, 7:50 PM
Michael Ngwerume
Michael Ngwerume - avatar
+ 1
Here is my primer on *args in Python - hope you find it useful! https://code.sololearn.com/cce88fWlK7L7/?ref=app
26th Apr 2018, 6:25 PM
Johannes
Johannes - avatar
0
List vs Tuple List: -Can use mutating function, method etc Tuple: -Can’t Both in common: -can access values: Ex) in,len,etc ——————————— Tuples are used like in here List1=[‘A’,’B’,’C’,’D’] List2=List1 List1[0]=‘Q’ print(list1) print(list2) _____________ Result: [‘Q’,’B’,’C’,’D’] [‘Q’,’B’,’C’,’D’] #1 the reason why this occurs is because list 2 is a mutable list. And list2=list1 means —-list2=list1= [‘A’,’B’,’C’,’D’]—- #2 also tuples are used as dictionary keys too.
3rd Jan 2018, 5:16 AM
Yololab
Yololab - avatar
0
In addition: Empty_list=[] Empty_list=list() Empty_tuple=() Empty_tuple=tuple()
3rd Jan 2018, 5:19 AM
Yololab
Yololab - avatar
0
invite me in WhatsApp bra 0734866612,and please challenge me in java or Python.am not good in HTML
3rd Jan 2018, 12:28 PM
Momelezi Qasana
Momelezi Qasana - avatar