Computer Science, asked by kumarnirmal447, 3 months ago

Write a python program to create a dictionary namely numbers with 5 keys(5,10,15,20,25) each having values as 100, update 2nd and 4th values by decreasing 50 to each of them.

Answers

Answered by vijayakumarchinthala
0

Answer:

dic={5:100,10:100,15:100,20:100,25:100}

dic[10]=50

dic[20]=50

Explanation:

Answered by jai696
3

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

my_dict = {k: 100 for k in [5, 10, 15, 20, 25]}

print("before:", my_dict)

for i in range(1, 4, 2):

my_dict[list(my_dict.keys())[i]] = list(my_dict.values())[i] - 50

print("after:", my_dict)

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

Similar questions