GRACE COE-CSE-GE3171-Problem Solving and Python Programming Laboratory-Ex5c(ii)



GRACE COE-CSE-GE3171-Problem Solving and Python Programming Laboratory-Ex5c(ii)- Implementing real-time/technical applications Elements of a Civil Structure using Dictionaries

This video shows how to write a python program to implement real-time/technical applications Elements of a Civil Structure using Dictionaries
PROGRAM:
elements = {“foundation”:14, “floors”:3, “walls”:19, “beams”:7}
print(elements)
x = elements.copy()
print(x)
x = elements.get(“beams”)
print(x)
x = elements.items()
print(x)
elements.update({“roof”:5})
print(elements)
x = elements.pop(“foundation”)
print(x)
print(elements)
x = elements.setdefault (“foundation”, 5)
print(x)
print(elements)
x = elements.values()
print(x)
y = 5
thisdict = dict.fromkeys(elements, y)
print(thisdict)
x = elements.keys()
print(x)
elements.clear()
print(elements)

source

Leave a Reply

Your email address will not be published.