125k views
5 votes
What is the value of the variable result after these lines of code are executed? >>> a = 5 >>> b = 2 >>> c = 7 >>> result = ab - cb An error occurred. 6 24 -4

User Ascension
by
4.1k points

2 Answers

3 votes

Answer:

An error occurred.

Step-by-step explanation:

User Dzs
by
4.9k points
6 votes

Answer:

The result of this is -4 is explained below.

Step-by-step explanation:

if we properly write the question

a = 5

b = 2

c = 7

result= (a*b) - (c*b)

print(result)

The result of (a*b) = 5*2 = 10

The result of (c*b) = 2*7 = 14

now (a*b) - (c*b) => 10-14 => -4

So the correct answer is -4

User Kemal AL GAZZAH
by
4.3k points