Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

jump to level 1 integer num_books is read from input representing the n…

Question

jump to level 1
integer num_books is read from input representing the number of books a library has. then, the library collection is increased to 2 times as many books. write an assignment statement that multiplies num_books by 2.
ex: if the input is 14, then the output is:
28
note: the variable num_books should appear on both the left and right side of the assignment statement.
learn how our autograder works
1 num_books = int(input())
2
4 print(num_books)

Explanation:

Step1: Multiply num_books by 2

num_books = num_books * 2

Step2: Insert line after input reading

Place the line between line 1 and line 4.

Answer:

The completed code is:

num_books = int(input())
num_books = num_books * 2
print(num_books)

When input is 14, the output is 28.