Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to multiply two tuples in python

#If you want to multiply the content of a tuple a given number of times, 
#you can use the * operator:

#Multiply the fruits tuple by 2:

fruits = ("apple", "banana", "cherry")
mytuple = fruits * 2

print(mytuple)

#Ouput: ('apple', 'banana', 'cherry', 'apple', 'banana', 'cherry')
Comment

PREVIOUS NEXT
Code Example
Python :: nested dict to df 
Python :: python current utc offset 
Python :: python code to find the length of string in a list 
Python :: how to run a function in interval in python 
Python :: pandas dataframe print decimal places 
Python :: rename columns in dataframe 
Python :: forbidden (csrf cookie not set.) django rest framework 
Python :: iterate through 2 strings python 
Python :: tqdm parallel 
Python :: random word py 
Python :: how to find the version of python command linw 
Python :: seaborn heatmap text labels 
Python :: or statement django template 
Python :: how to pick a random number in a list python 
Python :: django create model from dictionary 
Python :: python multi line print 
Python :: timer pythongame 
Python :: label encode one column pandas 
Python :: trimming spaces in string python 
Python :: Violin Plots in Seaborn 
Python :: python ssh library 
Python :: list of strings to numbers python 
Python :: python count distinct letters 
Python :: python ignore exception 
Python :: how to sort values in python from dictionary to list 
Python :: python writeline file 
Python :: python get lan ip 
Python :: how to export data from mongodb python 
Python :: set jupyer color to dark 
Python :: how to change kay bindings in pycharm 
ADD CONTENT
Topic
Content
Source link
Name
6+5 =