I'm new to python, So I was trying to make a login application. In this application, the main menu consists of 1) Creating acc, if you don't have one. 2) Login, to login with your previously created acc at 1). This is the code :
def main():
menu()
def menu():
menuOption = print("Choose your option"
"1) Create Acc"
"2) Login")
if menuOption == 1:
createAcc()
else:
login()
def createAcc():
input1 = input("Choose username : ")
input2 = input("Choose password : ")
return input1, input2
def login(input1 , input2):
print("Enter login details")
input3 = input("Enter username : ")
input4 = input("Enter password : ")
if input3 == input1 and input4 == input2:
print("Access granted")
else:
print("Access denied")
input1, input2 = createAcc()
login(input1, input2)
def information():
print("Enter your details")
name = input("Name : ")
age = input("Age : ")
pNum = input("Phone Number : ")
address = input("Address : ")
hpnum = input("Home telephone number : ")
def family():
print("Enter your family details ")
father = input("Father name : ")
mother = input("Mother name : ")
siblingCNT = input("How many siblings do you have?")
for i in range(siblingCNT):
sibName = input("Enter name : ")
main()
The problem is I got an error on line 12 at Login() def. This is the error :
TypeError: login() missing 2 required positional arguments: 'input1' and 'input2'
How to solve this and anything I can do to making my application better? Thanks in advance for any suggestions.
Btw I'm using vscode with the latest version and python 3.8.5 64-bit.