Please tell me what is wrong and why it is wrong? what is wrong with indentation? please explain
Error when input() is given below def():
Error when input() is given below def():
def details(name,age,address): name=input("Enter your name\n") age=input('enter age\n') address=input('Enter address\n') print(f'Hello: {name}') print(f'So you are {age} old') print(f'Your address is {address}') details(name,age,address) TypeError: details() missing 3 required positional arguments: 'name', 'age', and 'address'
For above code if parameters are not given the code works def details(): name=input("Enter your name\n") age=input('enter age\n') address=input('Enter address\n') print(f'Hello: {name}') print(f'So you are {age} old') print(f'Your address is {address}') details() O/P Hello: 22 So you are 22 old Your address is 22
If parameters are given this indentation works def details(name,age,address): print(f'Hello: {name}') print(f'So you are {age} old') print(f'Your address is {address}') name=input("Enter your name\n") age=input('enter age\n') address=input('Enter address\n') details(name,age,address) O/P Hello: 22 So you are 22 old Your address is 22
Larz60+ write Oct-06-2021, 10:31 AM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Please avoid using images for code.
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Please avoid using images for code.