0% found this document useful (0 votes)
2 views

Python Unit 9 Project

Uploaded by

jehee
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)
2 views

Python Unit 9 Project

Uploaded by

jehee
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
You are on page 1/ 7

Python Unit 9 Project

By Jess and William


Purpose
This code is a word counting code. It asks
five times for the user to enter a sentence
and the end result is all sentences listed. The
code then asks the specific word you wish to
count for example if a sentence says “I like
to ride bikes, I don’t like to run.” and the
request for word count is the word “to”, the
result will be that there are 2 “to”s in the
sentence. Then, it will ask user which
sentence they want to check and check if the
sentence starts with the word “what”. The
code can also count words start with a
vowel and make a list of those words start
with a vowel only.
How we got the idea
We came up with the idea based on the
concepts we had to use. This included the
use of 2D list, equivalence and identity, and
list comprehension. Due to the use of
equivalence and identity we first
brainstormed things that would be checked
off as “the same” or things that would
require splitting something large into
smaller parts. From these concepts we
formed out word count code.
Concepts used
The concepts we used were:
List comprehensions to make multiples lists. List
of words that contain specific letters and words
that start with a vowel
Equivalence and Identity to check if two words
input into the code were found multiple times
throughout the five sentences entered
2D lists were used to split paragraphs into
individual sentences and eventually single words
Other concepts used contain the two types of
nested for loop, functions and if-else statements,
Project link and video

Link to project Fire project


Reflection
1. We chose to make this design a word counting code due to the different functions we had to use. We
thought that paragraphs could be stored as a 2D list because it contains sentences, and each sentence
consists of words. And there are a lot of ways to manipulate the list of words.

2.While making this code, some challenges we faced were trials and errors when executing the code as
well as the use of paragraphs in our code. There were a lot of local variables in each function which
were hard to deal with, it was also more difficult to use 2D lists rather than a 1D list. We overcome
these challenges by writing down the purpose of each function and organizing the code by setting
appropriate names for the variables and more spaces between lines of code .

3.In the future we would improve the code by adding in more word checking functions and possibly
making the code shorter. Some of the functions are not very doable and need to be improved more.
There are also less interactions between users and the codes. This can also be improved by using more
input functions
Thankyou!!!

You might also like