Computer Science, asked by roopsaraon3285, 11 months ago

Write a simple python function to increase the value of any number by a constant "C=5" and write another simple function to update the value of "C" to any other value like 6,7,8, etc.# The required output is as:The incremented number is:15The incremented number is:110​

Answers

Answered by jai696
1

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

C = 5

increment = lambda n: f"The incremented number is: {n + C}"

def update_c(to):

global C

C = to

return f"Updated C to {to}"

print(increment((n := int(input("n: ")))), end = "\n\n")

print(update_c((to := int(input("to: ")))), end = "\n\n")

print(increment((n := int(input("n: ")))))

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

Similar questions