0% found this document useful (0 votes)
33 views11 pages

Comp Project 2024 25

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

Comp Project 2024 25

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

D.A.

V PUBLIC
SCHOOL
BISTUPUR
JAMSHEDPUR
SESSION :2023-24

COMPUTER INTERNAL ASSISSMENT


PROJECT
Submitted by:
This is to certify that Miss/Master ………………..... ,
………………....... , ………………....... ,
……………….......
(Class – XI A3) ,have successfully completed their
project “PYTHON PROGRAMMING LANGUAGE”
for the subject Computer Science(083)under the
guidance of, for 2nd Terminal
Exam(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)}")

elif choice == '2':


smallest_word = find_smallest_word(word_list)
print(f"The smallest word is '{smallest_word}' with
length {len(smallest_word)}")
elif choice == '3':
words_starting_a =
words_starting_with_a(word_list)
print(f"Words starting with 'a':
{words_starting_a}")

elif choice == '4':


search_word = input("Enter the word to search:
")
if search_word in word_list:
print(f"{search_word} is present in the string.")
else:
print(f"{search_word} is not present in the
string.")

elif choice == '5':


reversed_words = reverse_words(word_list)
print(f"Reversed words: {reversed_words}")

elif choice == '6':


three_letter_words_list =
three_letter_words(word_list)
print(f"All 3 letter words:
{three_letter_words_list}")

elif choice == '7':


words_ending_e =
words_ending_with_e(word_list)
print(f"Words ending with 'e': {words_ending_e}")

elif choice == '8':


word_occurrences =
count_word_occurrences(word_list)
print("Word occurrences:")
for word, count in word_occurrences.items():
print(f"{word}: {count}")

elif choice == '9':


character_count = count_characters(user_input)
for category, count in character_count.items():
print(f"{category}: {count}")

elif choice == '10':


insertion_sort(word_list)
print("Words sorted in ascending order:",
word_list)

elif choice == '0':


print("Exiting the program.")
break

else:
print("Invalid choice. Please enter a number
between 0 and 10.")

OUTPUT
BIBLIOGRAPHY

1. COMPUTER SCIENCE WITH


PYTHON BY SUMITA ARORA
2. www.wikipedia.org
3. www.geeksforgeeks.org python
4. CLASS NOTE
CONTENT

1.Acknowledgement
2.Overview of python
3.Source code
4.Output
5.Bibliography

You might also like