Computer Science, asked by AnanyG, 5 months ago

Write a program to create a dictionary

Employee= {‘name’: “Pulkit”, ‘age’: 16, ‘salary’: 50000}

1. Add department Employee[‘dept’]=’Sales’

2. Print all keys.

3. Print all values.

4. Delete Employee[‘age’]=16

5. Check ‘age’ in Employee

6. Calculate Length of the dictionary

7. Use Clear method​

Answers

Answered by jai696
1

\huge\red{\mid{\fbox{\tt{Using\: Python\: 3}}\mid}}

Employee = {"name": "Pulkit", "age": 16, "salary": 50000}

print("keys:", list(Employee.keys()))

print("values:", list(Employee.values()))

del Employee["age"]

print("age" in Employee)

print("Length:", len(Employee))

Employee.clear()

print(Employee)

\large\mathsf\color{lightgreen}useful?\: \color{white}\longrightarrow\: \color{orange}brainliest!

Answered by Japji21
0

Answer:

Employee = {"name": "Pulkit", "age": 16, "salary": 50000}

print("keys:", list(Employee.keys()))

print("values:", list(Employee.values()))

del Employee["age"]

print("age" in Employee)

print("Length:", len(Employee))

Employee.clear()

print(Employee)

Similar questions