Find us on Facebook

Thursday, December 13, 2018

TUPLES


Aim: Implement a Program to implement the concept of tuples.
Algorithm:
1.Start
2.Create a Zero-element tuple tuple a=()
3. Create a One-element tuple b = ("one",)
4. Create a Two-element tuple c = ("one", "two")
5.Print tuples and length.
6.Stop

Program:
# Zero-element tuple.
a = ()
# One-element tuple.
b = ("one",)
# Two-element tuple.
c = ("one", "two")
 
print(a)
print(len(a))
 
print(b)
print(len(b))
 
print(c)
print(len(c))
 
Output: 
()
0
('one',)
1
('one', 'two')

2

0 Comments:

Popular Posts

Text Widget

Search This Blog

Powered by Blogger.

Blogger Pages

Like Canvas?

Sponsor

Footer Widgetized Areas

About Canvas

About Canvas

Subscribe Us

About

Text Widget

Tags

Total Pageviews

print pdf

cal

Most Popular

    TUPLES
 LIST and SLICING
      ASCII VALUE
Copyright © KTU Btech Cse Python Lab Manuals | Powered by Blogger
Design by Saeed Salam | Blogger Theme by NewBloggerThemes.com | Distributed By Gooyaabi Templates