by: BJörn Lindqvist |
last post by:
I like tuples alot. But in some situations you seem to be forced to
access the elements of a tuple via its indexes and that is pretty
ugly. For example:
# make_color() returns a rgb tuple (r, g,...
|
by: Darren Dale |
last post by:
Hello,
def test(data):
i = ? This is the line I have trouble with
if i==1: return data
else: return data
a,b,c,d = test()
|
by: seberino |
last post by:
Tuples are defined with regards to parentheses ()'s as everyone knows.
This causes confusion for 1 item tuples since (5) can be interpreted
as a tuple OR as the number 5 in a mathematical...
|
by: Harlin Seritt |
last post by:
I have three tuples of the same size: tup1, tup2, tup3
I'd like to do something like this:
for a,b,c in tup1, tup2, tup3:
print a
print b
print c
Of course, you get an error when you try...
|
by: Steven D'Aprano |
last post by:
I'm trying to understand the use of tuples in function argument lists.
I did this:
>>> def tester(a, (b,c)):
.... print a, b, c
....
>>> tester(1, 2)
Traceback (most recent call last):...
|
by: nidhog |
last post by:
Hello guys,
I made a script that extracts strings from a binary file. It works.
My next problem is sorting those strings.
Output is like:
---- snip ----
200501221530
|
by: Tuvas |
last post by:
Let's say I make a program something like follows:
x=
x.append()
x.append()
print x
print x
print x
x=5
|
by: seberino |
last post by:
Please help me think of an example where immutable tuples are
essential.
It seems that everywhere a tuple is used one could just as easily use
a list instead.
chris
|
by: =?utf-8?B?TWFjaWVqIEJsaXppxYRza2k=?= |
last post by:
Hi Pythonistas!
I've got a question about storing tuples in a dictionary. First, a
small test case which creates a list of dictionaries:
import time
list_of_dicts =
keys =
prev_clk =...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|