Comp Project 2024 25
Comp Project 2024 25
V PUBLIC
SCHOOL
BISTUPUR
JAMSHEDPUR
SESSION :2023-24
………………………... ………………………..
Signature of the Internal Signature of the External
ACKNOWLEDGEMENT
We would like to express our special thanks
of gratitude to our teacher, Mrs.Alpana
Mishra , who gave us the golden opportunity
to do this wonderful project on the topic
,”Python Programming Language”, which
also helped us in doing a lot of research and
we came to know about so many things we
are really thankful to them.
Secondly we would also like to thank our
teachers who helped us a lot in finalizing the
project within the limited time frame.
OVERVIEW OF PYTHON
1) Python is a high-level, general-purpose
programming language. Its design philosophy
emphasizes code readability with the use
of significant indentation.
2) Python is dynamically typed and garbage-
collected. It supports multiple programming
paradigms,including structured (particularly proced
-ural), object-oriented and functional programming.
It is often described as a "batteries included"
language due to its comprehensive standard
library.
3) Guido van Rossum began working on Python in
the late 1980s as a successor to the ABC
programming language and first released it in
1991 as Python 0.9.0. Python 2.0 was released in
2000. Python 3.0, released in 2008, was a major
revision not completely backward-compatible with
earlier versions. Python 2.7.18, released in 2020,
was the last release of Python 2.
4) Python consistently ranks as one of the most
popular programming languages, and has gained
widespread use in the machine
learning community.
SOURCE CODE
def print_menu():
print("\nMenu:")
print("1. Print the biggest word along with length")
print("2. Print the smallest word along with length")
print("3. Print all words which start with 'a'")
print("4. Search a particular word in the string")
print("5. Print the reverse of each and every word of the
string")
print("6. Print all 3 letter words")
print("7. Print all words which end with 'e'")
print("8. Print the occurrence of each and every word")
print("9. Print count of vowels, consonants, digits, spaces,
upper case, lowercase, special characters")
print("10. Sort words in ascending order using insertion
sort")
print("0. Exit")
def get_word_list(sentence):
return sentence.split()
def find_biggest_word(words):
return max(words, key=len)
def find_smallest_word(words):
return min(words, key=len)
def words_starting_with_a(words):
return [word for word in words if word.lower().startswith('a')]
elif char.isdigit():
count['digits'] += 1
elif char.isspace():
count['spaces'] += 1
else:
count['special_characters'] += 1
return count
def insertion_sort(words):
for i in range(1, len(words)):
key = words[i]
j=i-1
while j >= 0 and key < words[j]:
words[j + 1] = words[j]
j -= 1
words[j + 1] = key
if __name__ == "__main__":
user_input = input("Enter a string: ")
word_list = get_word_list(user_input)
while True:
print_menu()
choice = input("Enter your choice (0-10): ")
if choice == '1':
biggest_word = find_biggest_word(word_list)
print(f"The biggest word is '{biggest_word}' with
length {len(biggest_word)}")
else:
print("Invalid choice. Please enter a number
between 0 and 10.")
OUTPUT
BIBLIOGRAPHY
1.Acknowledgement
2.Overview of python
3.Source code
4.Output
5.Bibliography