Python input() question ㅜ

Asked 2 years ago, Updated 2 years ago, 48 views

a, b = map(int, input().strip().split(' ')) print(a//b,a%b)

I want to divide a by b, divide a by b, and I want to print the rest, but why can't I print it out with the code above?<

input

2022-09-20 21:30

1 Answers

To write split, you must not turn the parameter over at all or pass the separator.

split('') won't work.

Use split() if you want to split based on spaces


2022-09-20 21:30

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.