12 questions
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?
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...
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...
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...
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...
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...
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 ...
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...
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, ...
- 1 - | » |
© 2024 OneMinuteCode. All rights reserved.