⚠
️ DEPRECATED GITLAB INSTANCE
⚠
️ This GitLab is now read-only for reference. Please use
https://gitlab.iauro.co
for all new work.
Migration completed on September 17, 2025
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
genai-module-1-assignment
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Packages
Packages
Container Registry
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Sagar Badhe
genai-module-1-assignment
Commits
e916deb8
Commit
e916deb8
authored
Jul 18, 2025
by
Sagar Badhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added third assignment
parent
b86d510f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
110 additions
and
0 deletions
+110
-0
calculator2.py
calculator2.py
+31
-0
studentmanagement.py
studentmanagement.py
+79
-0
No files found.
calculator2.py
0 → 100644
View file @
e916deb8
print
(
"Simple Calculator in Python"
)
firstnumber
=
float
(
input
(
"Enter first number: "
))
secondnumber
=
float
(
input
(
"Enter second number: "
))
print
(
"Select operation:"
)
print
(
"1. Addition"
)
print
(
"2. Subtraction"
)
print
(
"3. Multiplication"
)
print
(
"4. Division"
)
print
(
"5. Mod"
)
choice
=
input
(
"Enter choice (1/2/3/4/5): "
)
if
choice
==
"1"
:
result
=
firstnumber
+
secondnumber
elif
choice
==
"2"
:
result
=
firstnumber
-
secondnumber
elif
choice
==
"3"
:
result
=
firstnumber
*
secondnumber
elif
choice
==
"4"
:
if
secondnumber
==
0
:
result
=
"Error: Cannot divide by zero"
else
:
result
=
firstnumber
/
secondnumber
elif
choice
==
"5"
:
result
=
firstnumber
%
secondnumber
else
:
result
=
"Invalid operation"
print
(
"Result:"
,
result
)
studentmanagement.py
0 → 100644
View file @
e916deb8
class
Student
:
def
__init__
(
self
,
roll_no
,
name
,
marks
):
self
.
roll_no
=
roll_no
self
.
name
=
name
self
.
marks
=
marks
def
display
(
self
):
print
(
f
"Roll No: {self.roll_no}, Name: {self.name}, Marks: {self.marks}"
)
class
StudentManagementSystem
:
def
__init__
(
self
):
self
.
students
=
[]
def
add_student
(
self
):
roll_no
=
input
(
"Enter Roll No: "
)
name
=
input
(
"Enter Name: "
)
marks
=
float
(
input
(
"Enter Marks: "
))
student
=
Student
(
roll_no
,
name
,
marks
)
self
.
students
.
append
(
student
)
print
(
"Student added successfully!"
)
def
display_students
(
self
):
if
not
self
.
students
:
print
(
"No students to display."
)
else
:
print
(
"
\n
--- Student List ---"
)
for
student
in
self
.
students
:
student
.
display
()
def
search_student
(
self
):
roll_no
=
input
(
"Enter Roll No to search: "
)
for
student
in
self
.
students
:
if
student
.
roll_no
==
roll_no
:
print
(
"Student found:"
)
student
.
display
()
return
print
(
"Student not found."
)
def
delete_student
(
self
):
roll_no
=
input
(
"Enter Roll No to delete: "
)
for
student
in
self
.
students
:
if
student
.
roll_no
==
roll_no
:
self
.
students
.
remove
(
student
)
print
(
"Student deleted successfully!"
)
return
print
(
"Student not found."
)
def
main
():
sms
=
StudentManagementSystem
()
while
True
:
print
(
"
\n
====== Student Management System ======"
)
print
(
"1. Add Student"
)
print
(
"2. Display Students"
)
print
(
"3. Search Student"
)
print
(
"4. Delete Student"
)
print
(
"5. Exit"
)
choice
=
input
(
"Enter your choice (1-5): "
)
if
choice
==
"1"
:
sms
.
add_student
()
elif
choice
==
"2"
:
sms
.
display_students
()
elif
choice
==
"3"
:
sms
.
search_student
()
elif
choice
==
"4"
:
sms
.
delete_student
()
elif
choice
==
"5"
:
print
(
"Exiting... Goodbye!"
)
break
else
:
print
(
"Invalid choice! Please select between 1-5."
)
if
__name__
==
"__main__"
:
main
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment