We are doing print a list with the help of a short hand for loop technic.
thislist = ["apple", "banana", "cherry"] [print(x) for x in thislist]
We calling a function with correct number of arguments.
def my_function(fname, lname): print(fname + " " + lname) my_function("Emil", "Refsnes")
We creating global variable in the main body of python.
x = 300 def myfunc(): print(x) myfunc() print(x)
We are doing print a list.
list1 = ["abc", 34, True, 40, "male"] print(list1)
We printing a set that can have data of different data type.
set1 = {"abc", 34, True, 40, "male"} print(set1)
We printing a tuple that can have data of different data type.
tuple1 = ("abc", 34, True, 40, "male") print(tuple1)