years = int(input("Enter the # of years: "))
print("You are "+str(years*365)+" days old")
I wrote the code in python 3.8. I hope this helps!
I would say a calculator.
Plagiarism is taking the work of others word by word and saying that it’s yours.
Answer:
def check_password(pwd):
c=0
d=0
for i in pwd:
if (i>='a' and i<='z') or (i>='A' and i<='Z'):
c+=1
elif i>='0' and i<='9':
d+=1
c+=1
if len(pwd)==c and d>=2 and len(pwd)>=8:
print("valid password")
else:
print("Invalid password")
ps=input("Enter password for checking : ")
check_password(ps)
Explanation:
- Loop through the password and check if it contains any alphabet.
- Increment the counter if it contains any alphabet.
- If it contains a number, increment both c and d variables.
- Finally display the relevant message.