I'm new to this but can anyone tell me what does this line mean?
capacity = int(input())
I'm new to this but can anyone tell me what does this line mean?
capacity = int(input())
The input() function allows user input in the console.
But that input is a string and even if the user enters '343' you won't be able to use it as a number for mathematic operations.
So int() is a function that takes a string and returns the integer (whole number) represented by the string.
So you will use int(input()) when you want to get an input that can only be a number.
Tip: if the user enters random characters like 'abcd', the program will generate an error as those aren't numbers
int() changes a string to an integer. input() takes input as a string and int() convert it into an integer.