# assign total_owls with the sum of num_owls_a and num_owls_b. sample output for the given program:

208 views
I need to solve this program to assign total_owls with the sum of num_owls_a and num_owls_b. sample output for the given program, can anyone help me with this problem?

retagged

## Issue:

Assign total_owls with the sum of num_owls_A and num_owls_B.

The result or output for the program should be something like following:

Number of owls: 7 num_owls_A = '3' num_owls_B = '4' total_owls = 0 ' ' ' Remedy' ' ' print('Number of owls:', total_owls)

## Solution:

### Using int() method:

int method ie int() in Python helps to achieve this ,that takes a Number type or string type and converts the value to the integer object type.

syntax : int(x=0, base)

decimal is the default base type.

Check following python code for the sum of values in the num_owls_A and num_owls_B into total_owls:

def main():

num_owls_A='3'

num_owls_B='4'

total_owls=0

total_owls=int(num_owls_A)+int(num_owls_B)

print('Number of owls:', total_owls)

main()

by (1.6k points)