
Day34-Dictionary Methods
Dictionary Methods Dictionary uses several built-in methods for manipulation. They are listed below: i. update() The update() method updates the value of the key provided to it if the item already exi

Docstrings in python Python docstrings are the string literals that appear right after the definition of a function, method, class, or module. Example def square(n): '''Takes in a number n, return

String formatting in python String formatting can be done in python using the format method. txt = "For only {price:.2f} dollars!" print(txt.format(price = 49)) f-strings in python It is a new string

Create a program capable of displaying questions to the user like KBC. Use List data type to store the questions and their correct answers. Display the final amount the person is taking home after pla

Exercise 2: Good Morning Sir Create a python program capable of greeting you with Good Morning, Good Afternoon and Good Evening. Your program should use time module to get the current hour. Here is a

Manipulating Tuples Tuples are immutable, hence if you want to add, remove or change tuple items, then first you must convert the tuple to a list. Then perform operation on that list and convert it ba

Python Tuples Tuples are ordered collection of data items. They store multiple items in a single variable. Tuple items are separated by commas and enclosed within round brackets (). Tuples are unchang