0% found this document useful (0 votes)
4 views6 pages

Python Projects: Alarm Clock & Calculator

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views6 pages

Python Projects: Alarm Clock & Calculator

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

create a overleaf code on python programming report containg name of or-

ganisations ( code soft) candidate name Himanshu it also consist of two projects
first is alarm clock and another is scientific calculator with code and output
Got it! You want a **LaTeX (Overleaf) report template** that documents
your Python programming projects under the organization **Code Soft**, can-
didate **Himanshu**, containing two projects:
1. **Alarm Clock** (with Python code and output) 2. **Scientific Calcu-
lator** (with Python code and output).
Below is a complete Overleaf-ready LaTeX code:
***
“‘latex

1
ORGANIZATION: CODE SOFT

PYTHON
PROGRAMMING
REPORT

Candidate Name: Himanshu

[Link]

Submitted for: Internship / Training Project

Date: August 23, 2025


Contents
1 Overview 2

2 Python Code 2

3 Sample Output 2

4 Overview 3

5 Python Code 3

6 Sample Output 4

1
Introduction This report documents two Python programming projects com-
pleted under the organization Code Soft by candidate Himanshu. The projects
are:
1. Alarm Clock
2. Scientific Calculator
Project 1: Alarm Clock

1 Overview
The aim of this project is to build an alarm clock using Python that allows the
user to set an alarm time and notifies when the time matches.

2 Python Code
import datetime
import time
import winsound # For Windows ; use playsound on Linux / Mac

# Function to set alarm


def set_alarm ( alarm_time ) :
print ( f " Alarm set for { alarm_time } " )
while True :
current_time = datetime . datetime . now () . strftime ( " % H
:% M :% S " )
if current_time == alarm_time :
print ( " Time to wake up ! " )
winsound . Beep (1000 , 2000) # frequency , duration
break
time . sleep (1)

# Example to set alarm at specific time (24 - hour format )


alarm_time = input ( " Enter alarm time ( HH : MM : SS ) : " )
set_alarm ( alarm_time )
Listing 1: Alarm Clock Code

3 Sample Output
Enter alarm time (HH:MM:SS): 07:00:00
Alarm set for 07:00:00
Time to wake up!
(Beeping sound is played)
Project 2: Scientific Calculator

2
4 Overview
A scientific calculator in Python that provides basic and advanced mathematical
operations.

5 Python Code
import math

def calculator () :
print ( " Select operation : " )
print ( " 1. Addition " )
print ( " 2. Subtraction " )
print ( " 3. Multiplication " )
print ( " 4. Division " )
print ( " 5. Square Root " )
print ( " 6. Power " )
print ( " 7. Sine , Cosine , Tangent " )

choice = input ( " Enter choice (1 -7) : " )

if choice in [ ’1 ’ , ’2 ’ , ’3 ’ , ’4 ’ ]:
num1 = float ( input ( " Enter first number : " ) )
num2 = float ( input ( " Enter second number : " ) )

if choice == ’1 ’:
print ( " Result : " , num1 + num2 )
elif choice == ’2 ’:
print ( " Result : " , num1 - num2 )
elif choice == ’3 ’:
print ( " Result : " , num1 * num2 )
elif choice == ’4 ’:
if num2 != 0:
print ( " Result : " , num1 / num2 )
else :
print ( " Error : Division by zero " )

elif choice == ’5 ’:
num = float ( input ( " Enter number : " ) )
print ( " Square Root : " , math . sqrt ( num ) )

elif choice == ’6 ’:
base = float ( input ( " Enter base : " ) )
exp = float ( input ( " Enter exponent : " ) )
print ( " Result : " , math . pow ( base , exp ) )

elif choice == ’7 ’:
angle = float ( input ( " Enter angle in degrees : " ) )

3
rad = math . radians ( angle )
print ( " Sine : " , math . sin ( rad ) )
print ( " Cosine : " , math . cos ( rad ) )
print ( " Tangent : " , math . tan ( rad ) )

else :
print ( " Invalid Input " )

calculator ()

Listing 2: Scientific Calculator Code

6 Sample Output
Select operation:
1. Addition
2. Subtraction
3. Multiplication
4. Division
5. Square Root
6. Power
7. Sine, Cosine, Tangent
Enter choice (1-7): 1
Enter first number: 5
Enter second number: 7
Result: 12

Conclusion This report presented two projects developed in Python:

• An Alarm Clock to notify users at a given time.


• A Scientific Calculator performing fundamental and advanced mathemat-
ical operations.
These projects demonstrate the versatility and efficiency of Python for real-
world applications.

You might also like