Baekjun 10998 question (Python)

Asked 2 years ago, Updated 2 years ago, 18 views

Take two integers A and B and write a program that outputs A×B. Output A×B on the first line.

a,b = input().split()

a = int(a)

b = int(b)

print(a*b)

I'm a beginner who solved question 10998. I wonder why the code applied here doesn't work in ide.

In the visual studio code, It says not enough values to unpack (expected 2, got 1) and an error appears once you enter it.

python

2022-09-20 11:06

1 Answers

If you use the split function without a factor, the string is divided by the default spacing. It's not written, but I think you probably entered two numbers separately.

You can enter it based on spacing (#1 value, #2 value, ), or you can enter it twice without using the split


2022-09-20 11:06

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.