print(type(()))
print((1, 2, 3))
print(("One", "Two", "Three"))
print((1, 2, 3, ('One', 'Two', 'Three')))
<class 'tuple'>
(1, 2, 3)
('One', 'Two', 'Three')
(1, 2, 3, ('One', 'Two', 'Three'))
('One', 'Two', 'Three', 'Four')
('Two', 'Three')
('Two', 'Three')
('One', 'Two')
tp = (1, 2, 3, ('One', 'Two', 'Three', (True, False)))
print(tp[3][0])
print(tp[3][-2])
print(tp[3][3])
print(tp[3][3][-1])
One
Three
(True, False)
False
tp = (1, 2, 3, ('One', 'Two', 'Three', (True, False)))
print(tp[0:])
print(tp[1:3])
print(tp[-4:-2])
print(tp[3][1:3][:])
(1, 2, 3, ('One', 'Two', 'Three', (True, False)))
(2, 3)
(1, 2)
('Two', 'Three')
('one', 'Two', 'Three', 'four', 'five', 'six')
('one', 'Two', 'Three', 'one', 'Two', 'Three')
3
댓글남기기