Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

tuple with mixed data types

#Creating a Tuple
#with Mixed Datatype
Tuple1 = (5, 'Softhunt', 7, 'Tutorials')
print("
Tuple with Mixed Datatypes: ")
print(Tuple1)
 
#Creating a Tuple
#with nested tuples
Tuple1 = (0, 1, 2, 3)
Tuple2 = ('python', 'Softhunt')
Tuple3 = (Tuple1, Tuple2)
print("
Tuple with nested tuples: ")
print(Tuple3)
 
#Creating a Tuple
#with repetition
Tuple1 = ('Softhunt',) * 3
print("
Tuple with repetition: ")
print(Tuple1)
 
#Creating a Tuple
#with the use of loop
Tuple1 = ('Softhunt')
n = 5
print("
Tuple with a loop")
for i in range(int(n)):
    Tuple1 = (Tuple1,)
    print(Tuple1)
Comment

Creating a Tuple with Mixed Datatypes.

# Creating a Tuple
# with Mixed Datatype
Tuple1 = (5, 'Welcome', 7, 'Geeks')
print("
Tuple with Mixed Datatypes: ")
print(Tuple1)
 
# Creating a Tuple
# with nested tuples
Tuple1 = (0, 1, 2, 3)
Tuple2 = ('python', 'geek')
Tuple3 = (Tuple1, Tuple2)
print("
Tuple with nested tuples: ")
print(Tuple3)
 
# Creating a Tuple
# with repetition
Tuple1 = ('Geeks',) * 3
print("
Tuple with repetition: ")
print(Tuple1)
 
# Creating a Tuple
# with the use of loop
Tuple1 = ('Geeks')
n = 5
print("
Tuple with a loop")
for i in range(int(n)):
    Tuple1 = (Tuple1,)
    print(Tuple1)
Comment

PREVIOUS NEXT
Code Example
Python :: pandas count vvariables of each dtype 
Python :: find downold dir in python 
Python :: python tkinter gui does not update until function completes 
Python :: double linked list python 
Python :: drop columns by name 
Python :: python any( in list FOR LOOP 
Python :: cara ambil 2 kata menggunakan phyton 
Python :: Using pushbullet to export whatsapp chat 
Python :: How To Remove Elements From a Set using discard() function in python 
Python :: box plot seaborn advance python 
Python :: The float type in Python3 can represent decimal 0.1 without error. 
Python :: is boolean number python 
Python :: Draw GFG Geeks For Geeks Logo using Python and Turtle 
Python :: from django.urls import path, re_path 
Python :: numpy.floor_divide() in Python 
Python :: Get First In Table Django 
Python :: aws django create superuser 
Python :: pyPS4Controller usage 
Python :: mlpclassifier check weights 
Python :: django check if related object is None 
Python :: if else ifadesi 
Python :: python sort_values 
Python :: function print(text, times) 
Python :: isat in panadas datframe 
Python :: data parsing app python 
Python :: find location of a class in python 
Python :: plot a against b 
Python :: even number list generator 
Python :: max value from multiple columns pandas 
Python :: python empty list boolean 
ADD CONTENT
Topic
Content
Source link
Name
2+6 =