Python Pra12
Python Pra12
DOP: DOS:-
Practical No 12
1) Write a Python program to create a user defined module that will
ask your college name and will display the name of the college.
Code:-
# college_module.py
def get_college_name():
return college_name
# main.py
import college_module
def main():
college_name = college_module.get_college_name()
if __name__ == "__main__":
main()
Output:-
Code:-
import math
def calculate_circle_properties(radius):
if __name__ == "__main__":
try:
if radius < 0:
else:
except ValueError:
Code:-
import calendar
cal = calendar.TextCalendar()
print(month_calendar)
if __name__ == "__main__":
try:
display_calendar(year, month)
else:
except ValueError:
print("Invalid input. Please enter numeric values for year and month.")
Output:-