python report
python report
CO : CO1,CO2,CO3,CO4
Objective : sign in and signup with algorithm with captcha using python.
During sign-up, users can create a username and password, which are stored in
the dictionary. Successful registration offers the option to sign in or exit. In the
sign-in process, users are required to enter their credentials. If their username
and password match, they face a captcha challenge that involves solving a
randomly generated math problem.
If users correctly solve the captcha, they are considered successfully signed in,
although the script lacks further actions beyond displaying a success message. If
users fail to solve the captcha or provide incorrect credentials, they are
prompted to try again. If the username does not exist in the dictionary, they are
informed of a mismatch.
The script runs in an infinite loop until users exit or successfully authenticate.
While it provides a foundation for user authentication, it has limited practical
use beyond user verification. To enhance its utility, potential improvements
include better user interaction, clearer instructions, more descriptive variable
names, proper exit conditions, and error handling. Additionally, integrating it
into a larger project with specific post-authentication actions would increase its
applicability.
Program :
start=" "
def ini():
start=input('\n-enter to signin or press 1 to signup: ')
return start
def startt():
u=input('\nenter new user name: ')
p=input('enter new pass: ')
di.update({u:p})
pp=ini()
while True:
pp='1'
while pp=='1':
if pp2!='1':
pp=ini()
if pp!='1':
break
else:
pass
u=input('\nenter new user name: ')
p=input('enter new pass: ')
di.update({u:p})
pp2=ini()
if pp2=='1':
continue
else:
break
print("pass")
continue
if ent in di:
t=input("enter the password: ")
s = di[ent]
if s==t:
a=random.choice(list)
b=random.choice(list)
c=random.choice(ls)
if c=='-':
f=int(a-b)
elif c=='+':
f=int(a+b)
elif c=='*':
f=int(a*b)
print(f'{a}{c}{b}= ')
r=int(input('enter captcha'))
if f==r:
print("\nCongrats you have sucessfully signed IN\n ")
#write your code here
Pass
else:
print('enter valid captcha')
continue
else:
print("\nsorry wrong password try again\n")
continue
break
else:
print("\nsorry username dont match try again")
continue
else:
print("invalid captcha enter again")
Output :