write a function that accepts a list as input. the list consists of integers or lists containing integers. your function should return a list that is the same length as the input list. if the element in the input list is an integer, g

See Answers (1)

Accepted Answer

Elements are added to a list in Python by enclosing them in square brackets and separating them with commas. There can be any number of items in a list, and they can be of any type (integer, float, string, etc.).A list is an ordered data structure with elements surrounded in square brackets and separated by commas. Lists 1 and 2 below, for instance, each contain just one kind of data. In this case, list1 contains integers, and list2 has texts. As demonstrated in the list3 here, lists can also store mixed data types.# creating an empty listlst = []  # number of elements as inputn = int(input("Enter number of elements : "))  # iterating till the rangefor i in range(0, n):    ele = int(input())      lst.append(ele) # adding the element      print(lst)Learn more about element here-https://brainly.com/question/7212550#SPJ4

Related Question in Computers and Technology