Skip to content
This repository was archived by the owner on Dec 22, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
101 changes: 101 additions & 0 deletions Scripts/Miscellaneous/Prograamming Quiz GUI/Quiz.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
from tkinter import *
from tkinter import messagebox
from questions import *

class Project:
def __init__(self):
self.que=""
self.ans=""
self.correct=0
self.count=-1
self.__correct_answer=None
self.__answer=None
self.__question=None

def course(self):
self.correct=0
self.count=-1
B.config(text="Start")
if s.get()=="Python":
self.que=python_que
self.ans=python_ans
elif s.get()=="C":
self.que=c_que
self.ans=c_ans


def set_(self):
if self.que=="":
messagebox.showinfo("Error","Please select course first...")
return
self.count+=1

if self.count==len(self.que):
messagebox.showinfo("Result","You have answered {0} out of {1} questions correctly".format(self.correct,self.count))
sys.exit()

if(self.count==len(self.que)-1):
B.config(text="Finish")
else:
B.config(text="Next")

self.__question=self.que[self.count]
self.__answer=self.ans[self.__question]
l.config(text=self.__question)
for i in range(0,4):
v[i].set(self.__answer[i])
self.__correct_answer=self.__answer[4]

def fun(self,y,n):
if y==self.__correct_answer:
self.correct+=1
n.config(activebackground="green")
else:
n.config(activebackground="red")
self.set_()



obj=Project()
scr=Tk(className="quiz")
s=StringVar()
main_menu=Menu(scr)
file_menu=Menu(main_menu,tearoff=0)

course_menu=Menu(file_menu,tearoff=0)
course_menu.add_radiobutton(label="Python",value="Python",variable=s,command=obj.course)
course_menu.add_radiobutton(label="C",value="C",variable=s,command=obj.course)

file_menu.add_cascade(label="Course",menu=course_menu)
file_menu.add_command(label="Exit",command=exit)
main_menu.add_cascade(label="file",menu=file_menu)
scr.config(menu=main_menu)

l=Label(scr,font=("consolas",20),relief="groove",width=40,height=2,wraplength=600,bg="steel blue")
l.grid(row=0,column=0,columnspan=20,sticky="news")

b=[]
for i in range(0,4):
b.append(Button())
v=[]
for i in range(0,4):
v.append(StringVar())


b[0]=Button(scr,textvariable=v[0],font=("consolas",20),anchor="w",width=20,activebackground="light blue",command=lambda :obj.fun(v[0].get(),b[0]))
b[0].grid(row=2,column=0,sticky=W)

b[1]=Button(scr,textvariable=v[1],font=("consolas",20),anchor="w",width=20,command=lambda :obj.fun(v[1].get(),b[1]))
b[1].grid(row=2,column=1,sticky=S)

b[2]=Button(scr,textvariable=v[2],font=("consolas",20),anchor="w",width=20,command=lambda :obj.fun(v[2].get(),b[2]))
b[2].grid(row=3,column=0,sticky=W)

b[3]=Button(scr,textvariable=v[3],font=("consolas",20),anchor="w",width=20,command=lambda :obj.fun(v[3].get(),b[3]))
b[3].grid(row=3,column=1,sticky=S)

B=Button(scr,text="Start",font=("consolas",20),width=40,height=1,bg="black",fg="white",command=obj.set_)
B.grid(row=10,column=0,columnspan=2,sticky="news")
#B.geometry('{0}x{1}+0+0'.format(scr.winfo_screenwidth(),200))

scr.mainloop()
43 changes: 43 additions & 0 deletions Scripts/Miscellaneous/Prograamming Quiz GUI/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Programming Quiz Project
The project is about developing a quiz of 10 questions using python programming language on graphical user interphase.

### Prerequisites
1. Tkinter


### How to run the script
<li> Download the prerequisited library using `pip install tkinter` command on the terminal/command prompt
<li> Run the Graphical user Interphase using `python Quiz.py`
<li> Go to <strong>file</strong> menu to select the programming language for the quiz.
<li> Click on start button to proceed with the quiz

![script execution](Dashboard.jpg)

<li> After successful submission, a popup will display the result

![script execution](popup.jpg)

### Quiz Enhancement

<li> Changes in questions.py-: <br>
1. Add questions que dictonary (eg java_que={0 : ...,1 : ...})
<br>
2. Add option and answer to the answer dictonary ( eg java_ans={question : [options , correct answer]})
<br>
<li> Changes in Quiz.py <br>
1. Add th course to the course() function (Line 15)
<br>
elif s.get()=="Java":
<br>
<lr> self.que=java_que
<lr> self.ans=java_ans
<br>
2. Add course to the file menu (Line 65)
<br>
course_menu.add_radiobutton(label="Java",value="Java",variable=s,command=obj.course)
<br>
<li> Save and run the script using the instructions given above


## *Author Name*
[Pulkit Dhingra](https://github.com/Pulkit12dhingra)
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 49 additions & 0 deletions Scripts/Miscellaneous/Prograamming Quiz GUI/questions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
python_que={
0:"What is python",
1:"Who is founder of Python",
2:"What is variable",
3:"What is symbol of List",
4:"What is symbol of tuple",
5:"What is symbol of Set",
6:"What is symbol of dictionary",
7:"Python was launched in..",
8:"Latest Version of python is..",
9:"Python is suitable for.."
}
python_ans={
"What is variable":["Container","Object","Class","Structure","Object"],
"What is symbol of List":["( )","{ }","[ ]","None of the above","[ ]"],
"What is symbol of tuple":["( )","{ }","[ ]","None of the above","( )"],
"What is symbol of Set":["( )","{ }","[ ]","None of the above","{ }"],
"What is symbol of dictionary":["( )","{ }","[ ]","None of the above","{ }"],
"Who is founder of Python":["Steve Jobs","James Gosling","Guido von Rossum","Dennis Richie","Guido von Rossum"],
"Python was launched in..":["1990","2003","1980","1996","1990"],
"What is python":["Scripting language","Programming language","Markup Language","Snake","Programming language"],
"Latest Version of python is..":["3.8.4","3.9.5","3.8.9","3.9.0","3.9.0"],
"Python is suitable for..":["GUI Application","Web application","Android","All of these","All of these"]}

c_que={
0:"What is c",
1:"Who is father of c",
2:"What is strength of C language",
3:"C was launched in",
4:"What is format specifier of char",
5:"what is size of int in 64 bit os",
6:"what is format specifier of double",
7:"what is size of double",
8:"output of for(;;)",
9:"what is symbol of function"
}
c_ans={
"What is c":["Scripting language","Programming language","Markup Language","Snake","Programming language"],
"Who is father of c":["Steve Jobs","James Gosling","Guido von Rossum","Dennis Richie","Dennis Richie"],
"What is strength of C language":["data structure","Pointer","Speed","B and C both","B and C both"],
"C was launched in":["1970","1972","1980","1982","1972"],
"What is format specifier of char":["%ch","%c","%char","%chr","%c"],
"what is size of int in 64 bit os":["1 byte","8 bit","4 bit","32 bit","4 bit"],
"what is format specifier of double":["%d","%l","%lf","%Lf","%d"],
"what is size of double":["1 byte","8 bit","8 byte","32 bit","8 byte"],
"output of for(;;)":["syntax error","0 iteration","infinite iteration","runtime error","infinite iteration"],
"what is symbol of function":["( )","{ }","[ ]","< >","( )"]
}

54 changes: 54 additions & 0 deletions Scripts/Miscellaneous/heart attack analysis/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Heart Attack Analysis & Prediction

# Dataset Information

Heart attacks result in severe medical conditions that may be fatal if not handled correctly. Due to the current lifestyle, heart attacks are much more often than in the past. With the help of modern-day technologies and the capacity of storing the data, we can create a heart attack prediction mechanism that would allow us to measure the chances of having a heart attack on a person.

### Attribute Information:

Input variables: \
1 - Age : Age of the patient \
2 - Sex : Sex of the patient \
3 - exang: exercise induced angina (1 = yes; 0 = no) \
4 - ca: number of major vessels (0-3) \
5 - cp : Chest Pain type chest pain type \
<ul>
<li> Value 1: typical angina </li>
<li> Value 2: atypical angina </li>
<li> Value 3: non-anginal pain </li>
<li> Value 4: asymptomatic </li>
</ul>

6 - trtbps : resting blood pressure (in mm Hg) \
7 - chol : cholestoral in mg/dl fetched via BMI sensor \
8 - Trihalomethanes-> Amount of Trihalomethanes in μg/L \
9 - fbs : (fasting blood sugar > 120 mg/dl) (1 = true; 0 = false) \
10 - est_ecg : resting electrocardiographic results
<ul>
<li> Value 0: normal </li>
<li> Value 1: having ST-T wave abnormality (T wave inversions and/or ST elevation or depression of > 0.05 mV) </li>
<li> Value 2: showing probable or definite left ventricular hypertrophy by Estes' criteria </li>
</ul>
11 - thalach : maximum heart rate achieved

Output variable (based on sensory data): \
10 - target : 0= less chance of heart attack 1= more chance of heart attack


# Libraries


<li>pandas
<li>matplotlib
<li>seaborn
<li>plotly
<li>scikit-learn
<li>xgboost

# Algorithm
<li>XGBoost</li>

<br>

**Model Accuracy:** 80.00

Large diffs are not rendered by default.

Loading