tuple tag

12 questions


1 answers
63 views
0
Python Tuple

I heard that you can't change the tupleWhy does this code work? Didn't you change the tuple because the variable name is t?

1 years ago

2 answers
80 views
0
Sort descending to the second numeric value of the tuple in the list

word_list = [('this', 4), ('they', 3), ('that', 13), ('shall', 3), ('people', 3), ('nation', 5), ('here', 8), ('have', 5), ('great', 3), ('dedicated', 4), ('dead', 3)]How do I arrange these lists in o...

1 years ago

1 answers
88 views
0
Replace the tuple list with a string

There is data as a list in the tuple.# The join() is not working properly in the replace the data divided by split() as a string part.If you change the elements into strings one by one, it works as yo...

1 years ago

1 answers
119 views
0
Python repeat statement and tuple question. Masters, please help me

I'm taking a course called the return value of a function using a tuple. I'm posting a question because I don't understand something.names = [Cheolsoo, Younghee, Youngsoo]for i in range(len(names)): n...

1 years ago

1 answers
62 views
0
Python questions [('a', 5), ('b', 2), ('c', 1), ('b', 2), ('a', 9), ('d', 3), ('c', 13), ('e', 6)] sort data in numbers like this.

data = [('a', 5), ('b', 2), ('c', 1), ('b', 2), ('a', 9), ('d', 3), ('c', 13), ('e', 6)] This kind of data [('a', 14), ('c', 14), ('e', 6), ('b', 4), ('d', 3)] I'd like to make a list that sorts the v...

2 years ago

2 answers
85 views
0
Add ranking to Python questions [('a', 14), ('b', 14), ('c', 7), ('d', 6), ('e', 3), ('f', 1)].

list_a = [('a', 14), ('b', 14), ('c', 7), ('d', 6), ('e', 3), ('f', 1)]when [('a', 14, 1), ('b', 14, 1), ('c', 7, 3), ('d', 6, 4), ('e', 3, 5), ('f', 1, 6)]In this way, I want to rank them in descendi...

2 years ago

1 answers
130 views
0
Python [::] What do you call this?

If you use a string or array in Python, a = '123456789'print(a[::])#Output: 123456789There are times when [::] calls are used as above. What do you call this function?

2 years ago

1 answers
102 views
0
Questions about tuple-list conversion

I solved the problem of changing interest = ('Samsung Electronics', 'LG Electronics', 'SK Hynix') to list type with interest = ['Samsung Electronics', 'LG Electronics', 'SK Hynix'] and the answer was ...

2 years ago

1 answers
130 views
0
Is it impossible to take out the tuples on the list?

import itertoolsimport randomn = [1,2,3]a=list(itertools.combinations(n,2))b=list(random.choice(a))c =[]for x in a: if x not in b: c.append(x)print(a)print(b)print(c)I want to put the value of element...

2 years ago

2 answers
79 views
0
The coding of the exchange rate calculator using for door and tuple is blocked, so please give me a hint!

mymoney = input (ex. $100:)mymoney_sep = mymoney.split()mymoney_flo = float(mymoney_sep[0])toexch = input (Types of currency to exchange (ex. dollar, yen, euro, yuan, won):)# exchange = {'usd': 1167, ...

2 years ago
- 1 - »

© 2024 OneMinuteCode. All rights reserved.