Variables and Data Types

My question 1. Store the value 15 in a variable named a_value.
2. Store the result of (25 - 7) * 17 to a variable named a_result.
3. Using the print() command, display the following:

  • The value stored in the a_value variable.
  • The result of adding 12 to the variable a_result.
  • The result of adding a_value to a_result
    my answer
    a_value=15
    a_result= (25-7)*17
    print(a_value)
    print(a_result)
    print(a_value+12)
    print(a_result+a_value)
    Output
  • actual + expected

    15

  • 306

  • 27

  • 318
    321
1 Like

Welcome to the DQ community!

Unfortunately, I’m not sure what your question is exactly or where this exercise comes from…can you please provide a link to the mission? Maybe this link could help make your question more clear.

It looks like the instructions are asking you to print 3 results:

  • a_value
  • a_result + 12
  • a_value + a_result

But it appears you have 4 printed results (based on the output):

  • a_value :white_check_mark:
  • a_result :x:
  • a_value + 12 :x:
  • a_result + 12 :x:

Can you please clarify?

this is 2/12 of exercise
. I entered the data as given above and the answer is also stated above but the system isn’t accepting the result can you give the clue to move forward.

I’m not sure which exercise you’re referring to…can you provide a direct link to the mission please?

I found the mission you’re working on. It can be found here

Here is the solution I came up with and the system accepted it:

a_value=15
a_result=(25 - 7) * 17

print(a_value)
print(12 + a_result)
print(a_value + a_result)

What happens if you submit this?

Hi @zubairulhassan28

I think with what you have given, 12 is being added to a_result but you have added it to a_value instead, kindly recheck and do the changes, and also with the instruction given you should have three output , you shouldn’t print the value contained in the a_result for you to maintain the required output.