Skip to content

Commit

Permalink
Merge pull request #7 from Sankalp-sa/patch-1
Browse files Browse the repository at this point in the history
Create sankalp.py
  • Loading branch information
kanchuka123 authored Oct 1, 2023
2 parents 47c5932 + 2103543 commit ab4be56
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions sankalp.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Get the student's name and marks as input
student_name = input("Enter the student's name: ")
marks = float(input("Enter the student's marks: "))

# Calculate the grade based on the provided rules
if 100 >= marks >= 75:
grade = "A"
elif 75 > marks >= 65:
grade = "B"
elif 65 > marks >= 55:
grade = "C"
elif 55 > marks >= 35:
grade = "S"
elif 35 > marks >= 0:
grade = "F"
else:
print("Invalid marks entered. Marks should be between 0 and 100.")
exit()

# Print the grade of the student
print(f"Grade for {student_name}: {grade}")

0 comments on commit ab4be56

Please sign in to comment.