CBSE Class 12 Informatics Practices
Question 33 of 44
Solved 2025 Sample Question Paper CBSE Class 12 Informatics Practices (065) — Question 2
Back to all questions 2
Question Write a Python program to create the following DataFrame using a list of dictionaries.
| No | Product | Price |
|---|---|---|
| 0 | Laptop | 60000 |
| 1 | Desktop | 45000 |
| 2 | Monitor | 15000 |
| 3 | Tablet | 30000 |
import pandas as pd
d1 = {'Product': 'Laptop', 'Price': 60000}
d2 = {'Product': 'Desktop', 'Price': 45000}
d3 = {'Product': 'Monitor', 'Price': 15000}
d4 = {'Product': 'Tablet', 'Price': 30000}
data = [d1, d2, d3, d4]
df = pd.DataFrame(data)
print(df) Product Price
0 Laptop 60000
1 Desktop 45000
2 Monitor 15000
3 Tablet 30000