Тёмный
No video :(

tuple in python | Lec-16 

MANISH KUMAR
Подписаться 21 тыс.
Просмотров 1,1 тыс.
50% 1

In this video, I have talked about the fundamentals of programming and Python. If you complete this, you will be well-versed in using tuples for different use cases.
Directly connect with me at:- topmate.io/man...
Discord channel:- / discord
For more queries reach out to me on my below social media handle.
Follow me on LinkedIn:- / manish-kumar-373b86176
Follow Me On Instagram:- / competitive_gyan1
Follow me on Facebook:- / manish12340
My Second Channel -- / @competitivegyan1
Interview series Playlist:- • Interview Questions an...
My Gear:-
Rode Mic:-- amzn.to/3RekC7a
Boya M1 Mic-- amzn.to/3uW0nnn
Wireless Mic:-- amzn.to/3TqLRhE
Tripod1 -- amzn.to/4avjyF4
Tripod2:-- amzn.to/46Y3QPu
camera1:-- amzn.to/3GIQlsE
camera2:-- amzn.to/46X190P
Pentab (Medium size):-- amzn.to/3RgMszQ (Recommended)
Pentab (Small size):-- amzn.to/3RpmIS0
Mobile:-- amzn.to/47Y8oa4 ( Aapko ye bilkul nahi lena hai)
Laptop -- amzn.to/3Ns5Okj
Mouse+keyboard combo -- amzn.to/3Ro6GYl
21-inch Monitor-- amzn.to/3TvCE7E
27-inch Monitor-- amzn.to/47QzXlA
iPad Pencil:-- amzn.to/4aiJxiG
iPad 9th Generation:-- amzn.to/470I11X
Boom Arm/Swing Arm:-- amzn.to/48eH2we
My PC Components:-
intel i7 Processor:-- amzn.to/47Svdfe
G.Skill RAM:-- amzn.to/47VFffI
Samsung SSD:-- amzn.to/3uVSE8W
WD Blue HDD:-- amzn.to/47Y91QY
RTX 3060Ti Graphic card:- amzn.to/3tdLDjn
Gigabyte Motherboard:-- amzn.to/3RFUTGl
O11 Dynamic Cabinet:-- amzn.to/4avkgSK
Liquid cooler:-- amzn.to/472S8mS
Antec Prizm FAN:-- amzn.to/48ey4Pj

Опубликовано:

 

29 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 23   
@bolisettisaisatwik2198
@bolisettisaisatwik2198 4 месяца назад
Quick Notes: o Tuple is a data storage or a data structure or data type object in Python. A tuple can be updated by adding new values into it but cannot reassign an existing value by indexing method. The main features of tuples are: o Tuple: tuple = (1, 2, True, abcD) o Tuple gives an ordered output irrespective of input order. o Tuple is immutable object. o .count(2): gives the count of number of occurrences of 2 in the list or tuple. o Tuple.count(2)  1 o index(2): will give the First occurrence of the index number of the argument or number passed. o Tuple.index(2)  1
@user-sf7xi7zw6f
@user-sf7xi7zw6f 3 месяца назад
t1 = (10, 2, 3, 5) t2 = (3, 6, 4, 3) lst = [] for i in range(len(t1)): j = t1[i]**t2[i] lst.append(j) print(tuple(lst))
@SudiptaTripathy
@SudiptaTripathy 2 месяца назад
tuple1=(10,2,3,5) tuple2=(3,6,4,3) final_res=() for i in range(len(tuple1)): new_var=tuple1[i]**tuple2[i] tuple3=tuple([new_var]) final_res=final_res+tuple3 print(final_res)
@muktanandzarapkar5841
@muktanandzarapkar5841 3 месяца назад
import math t1 = (10, 2, 3, 5) t2 = (3, 6, 4, 3) t3=() for i in range(len(t1)): t3 = t3 + (pow(t1[i],t2[i]),) print(t3)
@tajveertyagi3084
@tajveertyagi3084 3 месяца назад
input_tuple = ([5, 6], [6, 7, 8, 9], [3]) result=() for sublist in input_tuple: for element in sublist: result=result+(element,) print(result)
@safiadawood5637
@safiadawood5637 4 месяца назад
Q1: test_tuple = ( [5,6], [6,7,8,9], [3]) result = () for lst in test_tuple: result = result + tuple(lst) print(result) Q2: tuple1 = (10,2,3,5) tuple2 = (3,6,4,3) output = () for i in range(len(tuple1)): output = output + (tuple1[i] ** tuple2[i],) print(output)
@divyaborse5866
@divyaborse5866 3 месяца назад
question 1: test_tuple =([5,6],[3]) res_tuple = () list1 = [] for i in test_tuple: print(i) for j in i: list1.append(j) print(tuple(list1)) Question 2: t1 =(10,2,3,5) t2 = (3,6,4,3) final_res = () for i in range(0,len(t1)): #res.append(t1[i] ** t2[i]) result = t1[i] ** t2[i] res = (result,) final_res = final_res + res print(final_res)
@VivekKhare-z1m
@VivekKhare-z1m Месяц назад
Q1. test_tuple = ([5,6],[6,7,8,9],[3]) test2 = () for lst in test_tuple: for inner_lst in lst: test2 += (inner_lst,) print(test2) Q2. tup1 = (10,2,3,5) tup2 = (3,6,4,3) new_tup = () for element in range(len(tup1)): result = (tup1[element]**tup2[element],) new_tup += result print(new_tup)
@anuragdasgupta6203
@anuragdasgupta6203 3 месяца назад
1. input = ([5, 6], [6,7,8,9], [3]) output = () for i in input: output = output + tuple(i) print (output) 2. tuple1 = (10, 2, 3, 5) tuple2 = (3, 6, 4, 3) result = [] # print(type(s)) for i in range(len(tuple1)): n = tuple1[i] ** tuple2[i] result.append(n) print(tuple(result))
@vinu11sharma
@vinu11sharma 4 месяца назад
tuple1 = (10, 2, 3, 5) tuple2 = (3, 6, 4, 3) final=() for i in range(len(tuple1)): rslt=tuple1[i] ** tuple2[i] print(type(rslt)) rslt1=(rslt,) print(type(rslt1)) final=final+rslt1 print(final)
@bolisettisaisatwik2198
@bolisettisaisatwik2198 4 месяца назад
How is everyone's second answer the same and none's is failing? When both the tuples are being iterated by i, then the second tuple has one less argument to pass and so the execution will fail. I think the correct way to handle that error would be this way. tuple1 = (10,2,3,5,6) tuple2 = (3,6,4,3) result = () for i in range(len(tuple1)): if i in range(len(tuple2)): result = result + (tuple1[i] ** tuple2[i],) else: break print(result) Note: Considering the input taken is same as the inputs provided by Manish. I might be wrong. Please educate, if i am wrong.
@AbhinavShukla-ki5jd
@AbhinavShukla-ki5jd Месяц назад
Q1: tt=([5,6],[6,7,8,9],[3,9,0]) l=[] for i in tt: for x in i: l.append(x) t=tuple(l) print(t) Q2: tt=(10,2,3,5,6) tt2=(3,6,4,3) rt=[] for i in range(len(tt2)): tw=pow(tt[i],tt2[i]) rt.append(tw) newrt=tuple(rt) print(newrt)
@AnuragRaut-ry2oq
@AnuragRaut-ry2oq 2 месяца назад
Problem 1 test_tuple = ([5,6],[6,7,8,9],[3]) result = () for lst in test_tuple: new_variable = tuple(lst) result = result + new_variable logger.info(f"The output tuple is {result}") Problem 2 tuple1 = (10,2,3,5) tuple2 = (3,6,4,3) final_tuple = () for i in range(len(tuple1)): result = (tuple1[i] ** tuple2[i],) final_tuple = final_tuple + result logger.info(f"The output tuple is {final_tuple}")
@user-sf7xi7zw6f
@user-sf7xi7zw6f 3 месяца назад
test_tuple = ([5,6], [6,7,8,9], [3]) # output: (5, 6, 6, 7, 8, 9, 3) lst = [] for i in test_tuple: if len(i) == 0: lst.append(i) else: for j in i: lst.append(j) print(tuple(lst))
@nupoornawathey100
@nupoornawathey100 4 месяца назад
Q1: lst=[] for tup in test_tuple: for t in tup: lst.append(t) print(tuple(lst)) # (5, 6, 6, 7, 8, 9, 3) Q2: tup=() for num in range(len(tuple1)): tup = tup + (tuple1[num] ** tuple2[num],) print(tup)
@ankitdhurbey7093
@ankitdhurbey7093 4 месяца назад
Q2 : tuple1 = (10,2,3,5) tuple2 = (3,6,4,3) final_result = () for i in range(len(tuple1)): exp = tuple1[i]**tuple2[i] final_result = final_result + (exp,) print(final_result)
@hariharanraman4181
@hariharanraman4181 4 месяца назад
Q1: from loguru import logger tuple_1=([5,6],[6,7,8,9], [3]) result=() result1=[] result1_tuple=() for lst in tuple_1: variable_name=tuple(lst) result=result+variable_name logger.info(result) for lst_1 in tuple_1: result1.extend(lst_1) result1_tuple=tuple(result1) logger.info(result1_tuple) Q2: from loguru import logger tuple1 = (10, 2, 3, 5) tuple2 = (3, 6, 4, 3) result=[] iterator=0 for t1 in tuple1: result.append(t1**tuple2[iterator]) iterator=iterator+1 logger.info(tuple(result))
@bolisettisaisatwik2198
@bolisettisaisatwik2198 4 месяца назад
I am getting this error when trying to convert the list into a tuple Error= TypeError: 'tuple' object is not callable My approach to the code. Tryed multiple other things, still seeing the same issue. print(list_to_tuple(result)) tuple_test = ([4, 5], [9, 7, 3], [81, 5]) result = [] def list_to_tuple(*args): return tuple(args) for lst in tuple_test: new_tuple = lst result.extend(new_tuple) print(list_to_tuple(result))
@vinu11sharma
@vinu11sharma 4 месяца назад
test_tuple=([5, 6], [6, 7, 8, 9],[3]) print(test_tuple) result=() for n in test_tuple: break_tuble = tuple(n) result=result+break_tuble print(break_tuble) print(result) print(result) result1=[] for n1 in test_tuple: break_tuble1=n1 result1=result1+break_tuble1 print(break_tuble1) print(result1) print(result1)
@raushansingh7530
@raushansingh7530 Месяц назад
# 2nd Question tuple1 = (10,2,3,5) tuple2 = (3,6,4,3) final_tuple=() for i in range(len(tuple1)): result = tuple1[i]**tuple2[i] # logger.info(result) final_tuple = final_tuple + (result,) logger.info(final_tuple)
@Cherry29-no9pb
@Cherry29-no9pb 4 месяца назад
Question1:: example1_tuple=([5,6],[6,7,8,9],[3]) example1_new_tuple=[] for i in example1_tuple: example1_new_tuple=example1_new_tuple+i example1_new_tuple=tuple(example1_new_tuple) logger.info(example1_new_tuple) Question2:: tuple1 = (10,2,3,5) tuple2 = (3,6,4,3) final_tuple=() for i in range(len(tuple1)): final_tuple=final_tuple+(tuple1[i]**tuple2[i],) logger.info(final_tuple)
Далее
set in python | Lec-17
34:53
Просмотров 1 тыс.
The Most Legendary Programmers Of All Time
11:49
Просмотров 553 тыс.
Oxxxymiron, ooes - журавли
00:19
Просмотров 55 тыс.
.join() method in python | Lec-20
24:04
Просмотров 1,3 тыс.
*args and **kwargs in python | Lec-22
33:21
Просмотров 1,4 тыс.
function in python | Lec-21
23:03
Просмотров 1 тыс.
K-Means Clustering Algorithm with Python Tutorial
19:20