Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Creating a list with several elements that are distinct or duplicate

# Creating a List with
# the use of Numbers
# (Having duplicate values)
List = [1, 2, 4, 4, 3, 3, 3, 6, 5]
print("
List with the use of Numbers: ")
print(List)
 
# Creating a List with
# mixed type of values
# (Having numbers and strings)
List = [1, 2, 'Softhunt', 4, '.net', 6]
print("
List with the use of Mixed Values: ")
print(List)
Source by softhunt.net #
 
PREVIOUS NEXT
Tagged: #Creating #list #elements #distinct #duplicate
ADD COMMENT
Topic
Name
4+7 =