Skip to content

Commit 76e2f4e

Browse files
committed
Ml Models
1 parent c48851b commit 76e2f4e

File tree

17 files changed

+3475
-31
lines changed

17 files changed

+3475
-31
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#Password Generator Project
2+
import random
3+
letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
4+
numbers = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
5+
symbols = ['!', '#', '$', '%', '&', '(', ')', '*', '+']
6+
7+
nr_letters = random.randint(8, 10)
8+
nr_symbols = random.randint(2, 4)
9+
nr_numbers = random.randint(2, 4)
10+
11+
password_list = []
12+
13+
for char in range(nr_letters):
14+
password_list.append(random.choice(letters))
15+
16+
for char in range(nr_symbols):
17+
password_list += random.choice(symbols)
18+
19+
for char in range(nr_numbers):
20+
password_list += random.choice(numbers)
21+
22+
random.shuffle(password_list)
23+
24+
password = ""
25+
for char in password_list:
26+
password += char
27+
28+
print(f"Your password is: {password}")
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
from tkinter import *
2+
3+
Calc=Tk()
4+
Calc.title("Calculator")
5+
Calc.minsize(400,500)
6+
7+
# entry_point=Entry(width=80,)
8+
Calc.config(padx=20,pady=20)
9+
# entry_point.grid()
10+
11+
# def calc_button():
12+
# Calc.config(entry_point.get())
13+
14+
# button =Button(text="9")
15+
# button.grid(column=0,row=0)
16+
button = Button(text="Button-1", height=3, width=10)
17+
button.grid(column=0,row=0)
18+
19+
button=Button(text="Button-2", height=3, width=10)
20+
button.grid(column=1,row=0)
21+
22+
23+
24+
Calc.mainloop()
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import tkinter as tk
2+
3+
def button_click(number):
4+
current = entry.get()
5+
entry.delete(0, tk.END)
6+
entry.insert(0, str(current) + str(number))
7+
8+
def button_clear():
9+
entry.delete(0, tk.END)
10+
11+
# def button_equal():
12+
# try:
13+
# expression = entry.get()
14+
# result = eval(expression) # Use eval() cautiously in real-world applications!
15+
# entry.delete(0, tk.END)
16+
# entry.insert(0, result)
17+
# except (SyntaxError, NameError, ZeroDivisionError):
18+
# entry.delete(0, tk.END)
19+
# entry.insert(0, "Error")
20+
21+
root = tk.Tk()
22+
root.title("Calculator")
23+
24+
entry = tk.Entry(root, width=35, borderwidth=5)
25+
entry.grid(row=0, column=0, columnspan=4, padx=10, pady=10)
26+
27+
buttons = [
28+
'7', '8', '9', '/',
29+
'4', '5', '6', '*',
30+
'1', '2', '3', '-',
31+
'0', '.', '=', '+'
32+
]
33+
34+
row = 1
35+
col = 0
36+
for button_text in buttons:
37+
button = tk.Button(root, text=button_text, padx=40, pady=20, command=lambda text=button_text: button_click(text) if text != '=' else button_equal() if text != 'C' else button_clear())
38+
button.grid(row=row, column=col)
39+
col += 1
40+
if col > 3:
41+
col = 0
42+
row += 1
43+
44+
clear_button = tk.Button(root, text="C", padx=40, pady=20, command=button_clear)
45+
clear_button.grid(row=row, column=col)
46+
47+
root.mainloop()

CyberQuestGame/Cyber security Project/Working With Csv File/2018_Central_Park_Squirrel_Census_-_Squirrel_Data.csv

Lines changed: 3024 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import csv
2+
import pandas
3+
4+
# with open("weather_data.csv") as file:
5+
# tempr= []
6+
# data = csv.reader(file)
7+
# for all_info in data:
8+
# tempr.append(all_info[1])
9+
# print(tempr)
10+
# res = [eval(i) for i in tempr[1:]]
11+
# print("Modified list is: ", res)
12+
13+
# a = pandas.read_csv("weather_data.csv")
14+
15+
# temp_list = a["temp"].to_list
16+
# print(temp_list)
17+
# average=0
18+
# for i in temp_list():
19+
# average+=i
20+
# print(average/len(temp_list()))
21+
22+
# print(a["temp"].max())
23+
# monday = a[a.Day=="Monday"]
24+
# print(monday.condition)
25+
# df = a.assign(Fahrenheit=lambda x: (9/5)*x['temp']+32)
26+
# print(df)
27+
28+
# scratch
29+
# new_file ={
30+
# "student": ["shubham", "sonali", "sonal"],
31+
# "score": [20, 10, 30]
32+
# }
33+
# data=pandas.DataFrame(new_file)
34+
# data.to_csv("trial.csv")
35+
36+
a = pandas.read_csv("2018_Central_Park_Squirrel_Census_-_Squirrel_Data.csv")
37+
cinammon_color_count = len(a[a["Primary Fur Color"]=="Cinnamon"])
38+
gray_color_count = len(a[a["Primary Fur Color"]=="Gray"])
39+
Black_color_count = len(a[a["Primary Fur Color"]=="Black"])
40+
41+
new_file = {
42+
"color": ["Cinammon", "gray", "black"],
43+
"total count": [cinammon_color_count,gray_color_count, Black_color_count]
44+
}
45+
data=pandas.DataFrame(new_file)
46+
data.to_csv("primary_fur_color.csv")
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import multiprocessing
2+
import time
3+
4+
5+
def letter():
6+
for i in "abcd":
7+
time.sleep(1)
8+
print(f"letter:{i}")
9+
10+
11+
def number():
12+
for i in range(5):
13+
time.sleep(1.5)
14+
print(f"number:{i}")
15+
16+
17+
if __name__ == "_main_":
18+
t1 = Process(target=letter)
19+
t2 = Process(target=number)
20+
21+
current_time = time.time()
22+
# start the thread
23+
t1.start()
24+
t2.start()
25+
# wait for thread to complete
26+
t1.join()
27+
t2.join()
28+
29+
used_time = time.time() - current_time
30+
print(used_time)
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
,color,total count
2+
0,Cinammon,392
3+
1,gray,2473
4+
2,black,103
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
,student,score
2+
0,shubham,20
3+
1,sonali,10
4+
2,sonal,30
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Day,temp,condition
2+
Monday,12,Sunny
3+
Tuesday,14,Rain
4+
Wednesday,15,Rain
5+
Thursday,14,Cloudy
6+
Friday,21,Sunny
7+
Saturday,22,Sunny
8+
Sunday,24,Sunny
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
question_data = [
2+
{"text": "A slug's blood is green.", "answer": "True"},
3+
{"text": "The loudest animal is the African Elephant.", "answer": "False"},
4+
{"text": "Approximately one quarter of human bones are in the feet.", "answer": "True"},
5+
{"text": "The total surface area of a human lungs is the size of a football pitch.", "answer": "True"},
6+
{"text": "In West Virginia, USA, if you accidentally hit an animal with your car, "
7+
"you are free to take it home to eat. ", "answer": "True"},
8+
{"text": "In London, UK, if you happen to die in the House of Parliament, "
9+
"you are entitled to a state funeral.", "answer": "False"},
10+
{"text": "It is illegal to pee in the Ocean in Portugal.", "answer": "True"},
11+
{"text": "You can lead a cow down stairs but not up stairs.", "answer": "False"},
12+
{"text": "Google was originally called 'Backrub'.", "answer": "True"},
13+
{"text": "Buzz Aldrin's mother's maiden name was 'Moon'.", "answer": "True"},
14+
{"text": "No piece of square dry paper can be folded in half more than 7 times.", "answer": "False"},
15+
{"text": "A few ounces of chocolate can to kill a small dog.", "answer": "True"}
16+
]

0 commit comments

Comments
 (0)