1. Write a Python code to replace a specific list item based on the conditions given below.
List name: Veg |
List item: Potato, Onion, Tomato |
Replace: Onion with Brinjal
Python Code
veg=[ "Potato", "Onion", "Tomato" ]
veg[1]="Brinjal"
print("The updated list of Veg ",veg)
2. Write a Python code for len function and min function.
Len( ) function
veg=[ "Potato", "Onion", "Tomato" ]]
print(len(veg))
min( ) function
n=[ 12,15,48,16,13,17,18 ]
print("The minimum number in the list is",min(n) )
max( ) function
n=[ 12,15,48,16,13,17,18 ]
print("The maximum number in the list is",max(n) )
3. Write a Python code for insert function to add or insert element in the existing list.
List name: Groceries |
List item: Dal, Salt, Oil | Insert/Add: Sugar
groceries=[ "Dal", "Salt", "Oil" ]
groceries.insert(1,"Sugar")
print("The updated list of groceries ",groceries)
4. Write a Python code for remove function to remove an element from the existing list.
a=[1,2,3,4,5]
a.remove(2)
print(a)
5. Write a Python code to display the Multiplication table of a given number.
for i in range(1,11):
n=15*i
print(f"{15}*{i}={n}")
6. Create a table and form to accept and store the values using Ms-Access.
Table name: Customer
Form Name: Bill
Fields to be added in the table: ID, Customer name, Bill amount, Phone Number.
super bro
ReplyDeleteThanks Bro
Delete