user
b1.php
<?php session_start(); $nm = $_GET['n']; $ps = $_GET['p']; if ($nm == $ps) echo "correct<br> LogIn Successful<br>Welcome!!!"; else if (isset($_SESSION['cnt'])) { echo $_SESSION['cnt'] . " Chances Used Invalid Login"; $_SESSION['cnt'] = $_SESSION['cnt'] + 1; if ($_SESSION['cnt'] > 3) echo "<br>Attempt Finished"; } else { $_SESSION['cnt'] = 1; echo "1 Chance Used Invalid Login"; } ?>b1.html
<html <body bgcolor=blue> <form action=b1.php method=get> <font size=6 color=blue> <pre> Enter Username : <input type=text name=n placeholder="username"><br> Enter Password : <input type=password name=p placeholder="password"><br> <input type=submit value=Login> <pre> </font> </body> </html>Importpandasaspd
Data={‘UserID’:[1,2,3,4,5,6,7,8,9,10]
‘Gender’:[‘Male’,‘Male’,‘Female’,‘Female’,‘Male’,‘Male’,‘Female’,‘Female’,‘Male’,‘Female’],
‘Age’:[19,35,26,27,19,27,32,25,33,45]
‘EstimatedSalary’:[19000,20000,43000,57000,76000,58000,82000,32000,69000,
65000],
‘Purchased’:[0,0,0,1,1,0,1,0,1,1]}
Df=pd.DataFrame(data)
Fromsklearn.model_selectionimporttrain_test_split
X=df.iloc[:,1:4].values
Y=df.iloc[:,4].values
X_train,X_test,y_train,y_test=train_test_split(X,y,test_size=0.3,random_state=0)
Fromsklearn.linear_modelimportLogisticRegression
Lr=LogisticRegression(random_state=0)
Lr.fit(X_train,y_train)
Observation=[[0,30,87000]]
Prediction=Lr.predict(observation)
Print(prediction)
observations=[[0,30,87000],[
1,50,45000],[1,22,30000]
]
Predicti
ons=Lr.predict(observati
ons)
Print(predi
ctions)