def myfun(): values = input("Input some comma-separated numbers: ") list1 = values.split(",") tuple1 = tuple(list1) # Print the list print('List : ', list1) # Print the tuple print('Tuple : ', tuple1) if __name__=="__main__": myfun()
Input some comma-separated numbers: 12,34,36,78,35,79 List : ['12', '34', '36', '78', '35', '79'] Tuple : ('12', '34', '36', '78', '35', '79')
Apply For Job
Java Material
Python Material
PLSQL Material
.Net Material
Print out a set containing all the colors from a list which are not present in other list
Write a Python program that concatenates all elements in a list into a string and returns it.
Write a Python program to calculate the sum of three given numbers. If the values are equal, return three times their sum.
Write a Python program that accepts a filename from the user and prints the extension of the file.
Write a Python program to find out what version of Python you are using.