Computer Science, asked by sownda985, 2 months ago

write a program that generates the following output 5,10,9 assign value 5to a variable using assignment operator (=)multiply it with 2to generate 10and subtract 1to generate 9​

Answers

Answered by allysia
0

Language:

Python

Program:

a_varaible = 5

a_variable*=2

a_varaible-=1

Explanation:

  • a+=1 is the same thing as a=a+1 which means the pervious value of a has been increased by 1.
  • Similarly, a*=2 is equivalent to a=a*2 so if the previous value of a was 10 the new value would be 10*2 i,,e 20.
  • Same logic works on a-=1.

Similar questions