I am building a very basic slot machine in python. This is the first python code I am doing, and am following a ytb tutorial. Somehow I am not getting the right result in terminal when I am testing out the code.
MAX_LINES = 3
def deposit():
while True:
amount = input("What would you like to deposit? $")
if amount.isdigit():
amount = int(amount)
if amount > 0:
break
else:
print("Amount must be greater than 0.")
else:
print("Please enter a number.")
return amount
def get_number_of_lines():
while True:
lines = input("Enter the number of lines to bet on (1-" + str(MAX_LINES) + ")? ")
if lines.isdigit():
lines = int(lines)
if 1 <= lines <= MAX_LINES:
break
else:
print("Enter a valid number of lines.")
else:
print("Please enter a number.")
return lines
def main():
balance = deposit()
lines = get_number_of_lines()
print(balance, lines)
main()
This is the code I wrote so far.
And here is what I get in Terminal ( I am doing this in VsCode).
What would you like to deposit? $200
Enter the number of lines to bet on (1-3)? 3
None None. \<\<this should say 3 ...
and further I did not get yet, but its a struggle to find the answer to this problem, there were some other people under the YouTube video who struggle/d with the same output in terminal.

You need to indent your
return ...lines correctly:Sorry, yes the
while True:indef get_number_of_lines():was also indented incorrectly.