In this python function program, we will create a function to print and accept login credentials.
What is Function?
It is a block of code that executes when it is called.
To create a function use def keyword.
Steps to solve the program
- Create a function login.
- Use the def keyword to define the function.
- Take name and password as input through the function.
- Then print Credential accepted.
- Call the function to print the output.
def login():
name = input("Enter name: ")
password = input("Enter password")
print("Credential accepted")
login()
Output :
Enter name: Atharv
Enter password1234
Credential accepted
Related Articles
Python function program to get the addition with the return statement.
Python function program to create a Fruitshop Management system.
Python function program to check whether the given year is a leap year.
Python function program to reverse an integer.
Python function program to create a library management system.
Python function program to add two Binary numbers.