Computer Science, asked by syedimram786, 3 months ago

write a program to create a dictionary namely Dct with 10 keys 0...9,each having same value as 200.update the first and last value by adding 200 to each of them.

in python.​

Answers

Answered by jai696
8

\large\mathsf\color{pink}{Solution\: using\: python\: 3}

Dct = {n: 200 for n in range(10)}

print(f"{Dct}\n")

Dct[list(Dct)[0]] += 200

Dct[list(Dct)[-1]] += 200

print(Dct)

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

Answered by Japji21
4

Answer:

Dct = {n: 200 for n in range(10)}

print(f"{Dct}\n")

Dct[list(Dct)[0]] += 200

Dct[list(Dct)[-1]] += 200

print(Dct)

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

Similar questions