HeidiMercado711 HeidiMercado711
  • 09-01-2020
  • Computers and Technology
contestada

What is the value of i printed? j = i = 1 i += j + j * 5 print("What is i?", i)

Respuesta :

teobguan2019
teobguan2019 teobguan2019
  • 10-01-2020

Answer:

7

Explanation:

Given the codes as follows:

  1. j = i = 1  
  2. i += j + j * 5  
  3. print("What is i?", i)

In line 1, the value of 1 is assigned to variable i and then the variable i is assigned to variable j. This means j will hold the value of 1 as well.

In line 2, j will be multiplied with 5 prior to the addition with j itself. So, j + j * 5 -> 1 + (1 * 5) -> 1 + 5 -> 6

Next, value of 6 will be added with i. i = i + 6  ->  i = 1 + 6 -> 7#

Eventually, value of 7 will be printed out (Line 3).

Answer Link

Otras preguntas

Agreement Would the following be go or goes? Neither the president nor the vice president go/goes to every meeting.
what is the classified matter of gold​
what is released when a nucleus is made
[tex]753 \times ..666[/tex]someone help me am trying to figure out​
What is 5(-3.4k-7)+(3k+21)
The Yagua people of Perú send their children to a one room school house. Their teacher's home is painted a certain color to easily identify them. What is the co
How did railroads help farmers in the late 1800s? A.They charged small farms higher shipping rates. B.They helped farmers transport their goods to wider markets
Can someone help me with this question please??
A game is played as follows: a die numbered 1 to 6 is rolled. If the number 1 comes up, you get nothing. If the number 2, 3, or 5 comes up, you win $4. If the n
What are some examples of endothermic and exothermic reactions?