Skip to content

Latest commit

 

History

History
33 lines (29 loc) · 586 Bytes

42. Unit 4 - Lesson 3.md

File metadata and controls

33 lines (29 loc) · 586 Bytes

Introduction to Lists

Q1. 3
Q2.

data = input("data: ")

# print type of input data here
print("type of data:",type(data))

list1 = data.split() # split() is used to convert a string into list
print("list:",list1)
print("type of list:",type(list1))

# print list1

# print type of list1

Q3.

a=input("data: ")
data=a.split(",")
print("list:",data)
print("type of list:",type(data))

Q4.

list1 = ["Python", 100, "Lists", 8.8,'A', "Program"]
print("List1 contains:",list1)
# print the list1 items
print("Type of list1:",type(list1))
# print the type of list1