⚠
️ 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
P
Pratiksha-Patil
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
Pratiksha Patil
Pratiksha-Patil
Commits
7c8eed6e
Commit
7c8eed6e
authored
Jun 25, 2025
by
Pratiksha Patil
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
first assignment of python
parent
e4c6e01b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
120 additions
and
0 deletions
+120
-0
python/calculator.py
python/calculator.py
+21
-0
python/file_parser.py
python/file_parser.py
+9
-0
python/student_management_system.py
python/student_management_system.py
+90
-0
No files found.
python/calculator.py
0 → 100644
View file @
7c8eed6e
def
add
(
x
,
y
):
return
x
+
y
def
subtract
(
x
,
y
):
return
x
-
y
def
multiply
(
x
,
y
):
return
x
*
y
def
divide
(
x
,
y
):
return
x
/
y
if
y
!=
0
else
"Error: Divide by zero"
print
(
"Select operation: +, -, *, /"
)
operation
=
input
(
"Operation: "
)
num1
=
float
(
input
(
"Enter first number: "
))
num2
=
float
(
input
(
"Enter second number: "
))
if
operation
==
'+'
:
print
(
"Result:"
,
add
(
num1
,
num2
))
elif
operation
==
'-'
:
print
(
"Result:"
,
subtract
(
num1
,
num2
))
elif
operation
==
'*'
:
print
(
"Result:"
,
multiply
(
num1
,
num2
))
elif
operation
==
'/'
:
print
(
"Result:"
,
divide
(
num1
,
num2
))
else
:
print
(
"Invalid operation"
)
python/file_parser.py
0 → 100644
View file @
7c8eed6e
filename
=
input
(
"Enter file name: "
)
try
:
with
open
(
filename
,
'r'
)
as
f
:
lines
=
f
.
readlines
()
for
i
,
line
in
enumerate
(
lines
,
1
):
print
(
f
"{i}: {line.strip()}"
)
except
FileNotFoundError
:
print
(
"File not found."
)
python/student_management_system.py
0 → 100644
View file @
7c8eed6e
class
Student
:
def
__init__
(
self
,
student_id
,
name
,
age
,
gender
,
grade
,
email
):
self
.
student_id
=
student_id
self
.
name
=
name
self
.
age
=
age
self
.
gender
=
gender
self
.
grade
=
grade
self
.
email
=
email
def
display
(
self
):
print
(
f
"ID: {self.student_id}, Name: {self.name}, Age: {self.age}, Gender: {self.gender}, Grade: {self.grade}, Email: {self.email}"
)
class
StudentManager
:
def
__init__
(
self
):
self
.
students
=
[]
def
add_student
(
self
):
print
(
"
\n
--- Add Student ---"
)
student_id
=
input
(
"Enter ID: "
)
name
=
input
(
"Enter Name: "
)
age
=
input
(
"Enter Age: "
)
gender
=
input
(
"Enter Gender: "
)
grade
=
input
(
"Enter Grade: "
)
email
=
input
(
"Enter Email: "
)
student
=
Student
(
student_id
,
name
,
age
,
gender
,
grade
,
email
)
self
.
students
.
append
(
student
)
print
(
"✅ Student added successfully!
\n
"
)
def
view_students
(
self
):
print
(
"
\n
--- Student List ---"
)
if
not
self
.
students
:
print
(
"No students available.
\n
"
)
else
:
for
student
in
self
.
students
:
student
.
display
()
def
update_student
(
self
):
print
(
"
\n
--- Update Student ---"
)
student_id
=
input
(
"Enter ID of student to update: "
)
for
student
in
self
.
students
:
if
student
.
student_id
==
student_id
:
student
.
name
=
input
(
"Enter new Name: "
)
student
.
age
=
input
(
"Enter new Age: "
)
student
.
gender
=
input
(
"Enter new Gender: "
)
student
.
grade
=
input
(
"Enter new Grade: "
)
student
.
email
=
input
(
"Enter new Email: "
)
print
(
"✅ Student updated successfully!
\n
"
)
return
print
(
"❌ Student not found.
\n
"
)
def
delete_student
(
self
):
print
(
"
\n
--- Delete Student ---"
)
student_id
=
input
(
"Enter ID of student to delete: "
)
for
student
in
self
.
students
:
if
student
.
student_id
==
student_id
:
self
.
students
.
remove
(
student
)
print
(
"✅ Student deleted successfully!
\n
"
)
return
print
(
"❌ Student not found.
\n
"
)
def
main
():
manager
=
StudentManager
()
while
True
:
print
(
"
\n
🎓 Student Management System"
)
print
(
"1. Add Student"
)
print
(
"2. View Students"
)
print
(
"3. Update Student"
)
print
(
"4. Delete Student"
)
print
(
"5. Exit"
)
choice
=
input
(
"Enter your choice (1-5): "
)
if
choice
==
'1'
:
manager
.
add_student
()
elif
choice
==
'2'
:
manager
.
view_students
()
elif
choice
==
'3'
:
manager
.
update_student
()
elif
choice
==
'4'
:
manager
.
delete_student
()
elif
choice
==
'5'
:
print
(
"👋 Exiting. Goodbye!"
)
break
else
:
print
(
"⚠️ Invalid choice. Please try again."
)
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