Internship Report Me 1

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 16

Submitted in Partial

Fulfillment of the
Requirements for the
Degree of

1 Anurag Gupta 2101650100028 C.S(A)

Kanpur Institute of Technology, Kanpur


Dr. A.P.J Abdul Kalam Technical University,
Lucknow
Weherebydeclarethatthissubmissionofourownworkandthat,toth
ebestof our knowledge and belief, it
contains no material previously published or
written by another person nor material which to a substantial extent has
been accepted
fortheawardofanyotherdegreeordiplomaortheuniversityorother
instituteofhigherlearning,exceptwheredueacknowledgementhasbeenmadein
thetext.

2
It gives us a great sense of pleasure to present the report of the B.Tech
internship/summer training undertaken during . We owe special debt
of gratitude to our guide for his constant support and guidance
throughoutcourseofourwork.Hissincerity,thoroughnessandperseverancehavebeena
constantsourceofinspirationforus.Itis onlyhis cognizantefforts
that ourendeavors havebeenlightoftheday.
Wealsotaketheopportunitytoacknowledgethecontributionof

forhisfulsupportandassistanceduringthedevelopmentoftheinternship/summer
training.
Wealsodonotliketomisstheopportunitytoacknowledgethecontributio
nofallfaculty
membersofthedepartmentfortheirassistanceandcooperationduringthedev
elopment of myinternship/
tran
in
ig. Last but not theleast, we acknowledge our friends for their
contributionsinthecompletionoftheinternship/summertraining.

3
The CodSoft Python Programming Internship provides hands-on
experience in designing and implementing Python-based projects. This
internship focuses on developing practical coding skills through three
foundational tasks:

Calculator:
A simple calculator application capable of performing basic arithmetic
operations. Users are prompted to input two numbers and select an
operation (addition, subtraction, multiplication, or division). The program
computes the result and displays it to the user, demonstrating foundational
programming and user interaction techniques.

Password Generator:
This project involves creating a password generator that produces strong,
random passwords based on user-specified criteria. Users input the
desired password length, and the application generates a secure password
by combining random characters, including letters, numbers, and symbols.
The tool emphasizes Python’s randomization capabilities and addresses
real-world needs for secure password generation.

Rock-Paper-Scissors Game:
A classic interactive game where users compete against the computer. The
program prompts the user to select rock, paper, or scissors, while the
computer makes a random choice. Game logic determines the outcome
based on the standard rules, and results are displayed to the user.
Optional features include score tracking and a replay option, enhancing
user engagement. This task introduces participants to conditional logic,
random number generation, and iterative programming.

Through these tasks, the internship fosters problem-solving, coding


efficiency, and user-centric application design, equipping participants with
essential programming skills.

4
1. Overview of the
Internship
2. Objectives

3. Task Description
4. Features and
Functionality
5. Steps to Implement
6. Example Workflow
1. Input 3
2. Task
1. Output
Description
2. Features and
Functionality
3. Steps to Implement
4. Example Use Case
1. Input
2. Output 4
1. Task Description
2. Features and
Functionality
3. Steps to Implement
4. Example Game Flow
1. User
2. Computer
3. Output 5
1. Programming Concepts
Practiced
2. Real-World Applications 6
6.1 Sample Code for
Tasks 7
1. Summary of Tasks
2. Future Enhancements and
Applications

5
The CodSoft Python Programming Internship is a project-based
learning opportunity designed to help participants gain practical
experience in Python programming by completing real-world tasks.

The internship aims to:

 Strengthen participants' understanding of Python


fundamentals.
 Build problem-solving skills through project
implementation.
 Develop user-friendly applications addressing
practical needs.

8
Create a simple calculator application capable of performing
basic arithmetic operations (addition, subtraction,
multiplication, and division).

 Accepts two numeric inputs from the user.


 Allows the user to choose an operation
(e.g., addition).
 Outputs the calculated result.

1. Prompt the user to enter two numbers.


2. Ask the user to select an operation (+, -, *, /).
3. Use conditional statements to perform the
chosen operation.
4. Display the result of the calculation.

 Input:
 First Number:
10
 Second
Number: 5
 Operation: *
Output:
Result: 50

9
Design a password generator application that produces
secure, random passwords based on user preferences.

 Allows users to specify the password length.


 Generates a strong password using random characters,
including letters, numbers, and symbols.
 Displays the generated password to the user.

1. Prompt the user to specify the desired password length.


2. Use Python libraries like random or secrets to create a
secure password with a mix of character types.
3. Output the generated password to the user.

 Input:
 Password Length: 10
 Output: Generated Password: J8!
xY@#2Kd

10
Develop a text-based Rock-Paper-Scissors game where the user
competes against the computer.

 User chooses rock, paper, or scissors.


 Computer randomly selects rock, paper,
or scissors.
 The game logic determines the winner.
 Optionally, track scores and allow
replaying.

1. Prompt the user to choose rock, paper, or


scissors.
2. Use the random module to generate the
computer's choice.
3. Implement game rules:
 Rock beats scissors.
 Scissors beat paper.
 Paper beats rock.
4. Compare the choices and display the result
(win, lose, or tie).
5. Optionally, track scores and prompt for replay.

 User: Rock
 Computer: Scissors
 Output:
 "You chose Rock. The computer chose
Scissors."
 "You win! Rock beats Scissors."

11
 Input/output handling.
 Conditional logic and loops.
 Randomization using Python libraries.
 Structuring code for readability and functionality.

 Real-World Applications:

 Task 1: Calculator demonstrates creating utility


tools.
 Task 2: Password Generator addresses security
needs.
 Task 3: Rock-Paper-Scissors introduces game logic
development.

 Task 1: Calculator demonstrates creating utility


tools.
 Task 2: Password Generator addresses security
needs.
 Task 3: Rock-Paper-Scissors introduces game logic
development.

12
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): if y ==

0:

return "Error: Division

by zero" return x / y

def main():

print("Simple
13
Calculator")

print("Select
try:

choice = input("Enter choice

(1/2/3/4): ") if choice in ['1', '2',

'3', '4']:

brea

else:

print("Invalid input. Please enter 1,

2, 3, or 4.") except ValueError:

print("Invalid input. Please enter a

number.") while True:

try:

num1 = float(input("Enter first

number: ")) num2 =

float(input("Enter second number:

")) break

except ValueError:

print("Invalid input. Please enter

numbers.") if choice == '1':

result =

add(num1, num2)

operation =

"Addition"

elif choice == '2':

result =

subtract(num1, num2)
14
operation =

"Subtraction"
result = divide(num1, num2)

operation = "Division"

print(f"The result of {operation} ({num1} and

{num2}) is: {result}") if name == "

main ":

main()

import random

import string

def

generate_password(len

gth): lower =

string.ascii_lowercase

upper =

string.ascii_uppercase

digits = string.digits

symbols =
string.punctuation

all_characters = lower +
upper + digits +
symbols

password = ''.join(random.choice(all_characters) for _ in

range(length)) return password

def main():

while True:

try:

length = int(input("Enter the desired length of the

password: ")) if length < 1:


15
print("Please enter a positive

number.") continue
print("Invalid input. Please enter a
number.")

password =

generate_password(length)

print("Generated Password: ",

password)

if name == "

main ": main()


import random

def get_computer_choice():

choices = ["rock", "paper",

"scissors"] return

random.choice(choices)

def determine_winner(user_choice,

computer_choice): if user_choice ==

computer_choice:

return "It's a tie!"

elif (user_choice == "rock" and computer_choice ==

"scissors") or \ (user_choice == "scissors" and

computer_choice == "paper") or \ (user_choice ==

"paper" and computer_choice == "rock"):

return "You

win!" else:

return "You
lose!"

def display_result(user_choice,

computer_choice, result): print(f"\nYou


16
chose: {user_choice}")

print(f"Computer chose:
user_score = 0

computer_scor

e = 0 while

True:

user_choice = input("\nChoose rock, paper, or

scissors: ").lower() if user_choice not in ["rock",

"paper", "scissors"]:

print("Invalid choice. Please

try again.") continue

computer_choice =
get_computer_choice()

result = determine_winner(user_choice,

computer_choice) display_result(user_choice,

computer_choice, result)

if result == "You

win!":

user_score +=

elif result == "You

lose!":

computer_score

+= 1

print(f"\nScores -> You: {user_score} | Computer:

{computer_score}") play_again = input("Do you want

to play again? (yes/no): ").lower()

if play_again != "yes":
17
print("Thanks for

playing!") break
Participants implemented a calculator, a password
generator, and a Rock- Paper-Scissors game, each
highlighting key Python concepts.

 Add GUIs to improve usability.


 Expand functionality, such as generating complex
passwords or adding multiplayer options to the
game.

18

You might also like