CBSE Class 12 Informatics Practices Question 34 of 44

Solved 2025 Sample Question Paper CBSE Class 12 Informatics Practices (065) — Question 3

Back to all questions
3
Question

Question 30B

Write a Python Program to create a Pandas Series as shown below using a dictionary. Note that the left column indicates the indices and the right column displays the data.

RussiaMoscow
HungaryBudapest
SwitzerlandBern
Solution
import pandas as pd 
data = {'Russia':'Moscow','Hungary':'Budapest','Switzerland':'Bern'} 
s = pd.Series(data) 
print(s)
Output
Russia           Moscow
Hungary        Budapest
Switzerland        Bern
dtype: object
Answer