HARDWARE AND SOFTWARES
REQUIRED
HARDWARES:--
1. Desktop / Laptop
2. Mobile Phone
SOFTWARES
1. Python (Latest version)
ACKNOWLDEGMENT
It is with pleasure that I acknowledge my
sincere gratitude to our teacher, MR. SUNIL
KUMAR, PGT(CS) who taught and undertook
the responsibility of teaching the subject
computer science. I have been greatly
benefited from his classes.
I am especially indebted to our Principal MR.
RAJEEV RANJAN PRASAD SINHA who has
always been a source of encouragement and
support and without whose inspiration this
project would not have been a successful. I
would like to place on record a heartfelt
thanks to him.
CERTIFICATE
This is to certify that BHAVESH of class XI-A of
SARVODAYA VIDYALAYA SECTOR—7 has done his
project of MULTIPLE GAME SYSTEM under my
supervision. He has taken interest and has shown at
most sincerity in completion of this project.
I certify this project up to my expectation & as per
guidelines issued by CBSE, NEW DELHI.
INTERNAL EXAMINER PRINCIPAL
TABLE OF CONTENTS
S.No. Topic Page No.
1 Certificate 1
2 Acknowledgment 2
3 Hardware and 3
software
required
4 Introduction 5
5 Python Source 6
code
6 Outputs 9
7 References 12
INTRODUCTION
The Multiple Games System is a Python-based project
designed to provide an engaging and interactive experience
for users.
The system offers a variety of classic and popular games
integrated into single application making it convenient for
users to access and enjoy multiple games from one
platform.
Key features of the project:--
User friendly interface that is simple and easy to
navigate.
Includes games like HANGMAN, NUMBER GUESSING
etc.
Designed with basic programming technique.
This project not only showcases practical implementation
of Python concepts but also enhances problem solving. Its
perfect example of how programming can be used to
create fun and functional applications.
PYTHON SOURCE
CODE
import random
def hangman():
words = ['python', 'hangman', 'challenge', 'programming',
'developer']
word = random.choice(words)
guessed = '_' * len(word)
guessed_list = list(guessed)
attempts = 6
guessed_letters = set()
print("Welcome to Hangman!")
while attempts > 0 and '_' in guessed_list:
print('Current word:', ' '.join(guessed_list))
print(f'Attempts remaining: {attempts}')
guess = input('Guess a letter: ').lower()
if guess in guessed_letters:
print("You've already guessed that letter.")
continue
elif len(guess) != 1 or not guess.isalpha():
print("Please enter a single letter.")
continue
guessed_letters.add(guess)
if guess in word:
for index, letter in enumerate(word):
if letter == guess:
guessed_list[index] = guess
print("Good guess!")
else:
attempts -= 1
print("Wrong guess!")
if '_' not in guessed_list:
print(f'Congratulations! You guessed the word: {word}')
else:
print(f'Sorry, you ran out of attempts. The word was: {word}')
def number_guessing_game():
number_to_guess = random.randint(1, 100)
attempts = 10
print("Welcome to the Number Guessing Game!")
while attempts > 0:
guess = int(input(f'Guess a number between 1 and 100 (Attempts
left: {attempts}): '))
if guess < number_to_guess:
print("Too low!")
elif guess > number_to_guess:
print("Too high!")
else:
print(f'Congratulations! You guessed the number:
{number_to_guess}')
return
attempts -= 1
print(f'Sorry, you ran out of attempts. The number was:
{number_to_guess}')
def word_guessing_game():
words = ['apple', 'banana', 'cherry', 'date', 'elderberry']
word = random.choice(words)
guessed_word = ''
attempts = 5
print("Welcome to the Word Guessing Game!")
while attempts > 0:
guess = input('Guess the word: ').lower()
if guess == word:
print(f'Congratulations! You guessed the word: {word}')
return
else:
attempts -= 1
print(f'Wrong guess! Attempts left: {attempts}')
print(f'Sorry, you ran out of attempts. The word was: {word}')
def main():
while True:
print("\nChoose a game to play:")
print("1. Hangman")
print("2. Number Guessing Game")
print("3. Word Guessing Game")
print("4. Exit")
choice = input("Enter your choice (1-4): ")
if choice == '1':
hangman()
elif choice == '2':
number_guessing_game()
elif choice == '3':
word_guessing_game()
elif choice == '4':
print("Thanks for playing!")
break
else:
print("Invalid choice. Please choose again.")
if __name__ == "__main__":
main()
OUTPUTS
Starting of the program:-
Choosing game to play:--
WORKING OF PROGRAM
REFERENCES
Python
https://www.python.org/
Class 11th Computer Science books
SARVODAYA VIDYALAYA
SECTOR---7
COMPUTER SCIENCE PROJECT
2024-25
Submitted by:
Name:-- BHAVESH
Class:-- XI- A
Topic:-- Multiple Games System
Under the guidance of:
Mr. SUNIL KUMAR, PGT(CS)