PYTHON

Create a number list in Python

n=int(input("Enter number of elements: ")) list_1 = [] for i in range(n): value = int(input(f"Enter element {i+1}: ")) list_1.append(value) print("Dynamic List:", list_1) list_1.extend([14,15,12]) list_1.sort() print(list_1)

OUTPUT……

Leave a Reply

Your email address will not be published. Required fields are marked *

sign up!

We’ll send you the hottest deals straight to your inbox so you’re always in on the best-kept software secrets.