Assignment Rules: Open book and notes assignment This homework tests

Assignment Rules:
Open book and notes assignment

  1. This homework tests your knowledge of File Handling, use of String methods, and use of Sets.
  2. Adhere to the naming conventions discussed in class for variable names, program name and function names
  3. Use meaningful names for variables, functions etc
  4. If there are two words in the variable use first word lowercase and first letter of second word upper case i.e., firstName or underscore between 2 words i.e first_name
  5. Include appropriate comments in the code
  6. Output should be displayed similar to as mentioned against each problem
  7. Indent the lines of code appropriately

1. char_analysis.py (40 points)

Write a program that reads the file’s contents and determine the following:

  1. The number of Uppercase letters in the file
  2. The number of Lowercase letters in the file
  3. The number of digits in the file
  4. The number of whitespace characters in the file

HINTS:

Define main():

Declare Local variables

Open file text.txt for reading. Use ‘text.txt’ file available under the Modules section in Canvas.

Use for loop to step through each character in the file.

Determine if the character is uppercase, lowercase, a digit, or space, and keep a running total of each.

Close the file.

Display the totals of uppercase, lowercase, digits, spaces.

Sample Output:

Uppercase letters: 29
Lowercase letters: 1228
Digits: 30

Spaces: 260

2. unique.py (30 points)

Write a program that opens a specified text file (text2.txt) and displays a list of all unique words found in the file.

HINTS:

Define main():

Declare Local variables

Open file text2.txt for reading. Use ‘text2.txt’ file available under the Modules section in Canvas.

Use ‘set’ method to find the unique words in the file and store each of them as an element of the set. 

Close the file.

Display all the unique words from the set.

Sample output:

These are the unique words in the text:
management.
name
been
later,
canceled,
is
Eastern,
delay
Eight
1,820
at
it
1867
official
world
and
company,….

3. name.py (30)

Write a program that gets a string containing a person’s first, middle, and last names, and displays their first, middle, and last initials. For example, if the user enters Susan Smith Miller, the program should display S.S.M.

Define main():

Declare Local variables

Prompt user to enter the full name

Use ‘split’ method to split the full name

Use for loop to get first character of each name as an initial

Convert the first character to upper case if it is already not in upper case

Display output

Sample output:

Enter your full name: Susan Smith Miller
S.S.M.

Share This Post

Email
WhatsApp
Facebook
Twitter
LinkedIn
Pinterest
Reddit

Order a Similar Paper and get 15% Discount on your First Order

Related Questions

Global Journal Assignment # 4 – Write 3 or 4

 Global Journal Assignment # 4 – Write 3 or 4 well developed paragraphs. Topic:  What does it mean to be a global citizen?  Points to cover:  1.  Definition of a global citizen2.  How do ethical and social responsibility considerations affect the actions of a global citizen?3.  How does international law

compare Celia, A Slave, by Melton Mclaurin

 You have read the book, Celia, A Slave, by Melton Mclaurin during the second half of our course. For your final exam, write an essay that relates the book to the unit essays that you have completed over the last five weeks. Not all of your essays may relate to

Response #2: Go back into your own initial post. Identify

  Response #2: Go back into your own initial post. Identify what diagnostic testing or additional information you might need to establish a diagnosis. Identify what you believe is the correct diagnosis for the patient in the case study with the rationale for your response. Identify why the differential diagnoses

Strategic Organizational Goal Paper Nursing Assignment Help

You will select a Strategic Organizational Goal from the following list that you will use to develop a strategic plan for your proposed health information system: Research and education Patient Care: Quality improvement Patient Care: Sharing data across the system Patient Care: Non-acute services Financial stability Before beginning to develop

Read the case study “Pointsec Mobile Technology” under Appendix #

Read the case study “Pointsec Mobile Technology” under Appendix # 1 in this syllabus and write a paper that provides: ● An introduction to the case ● Explanations of the:  ▪ Flaws in research design in this study,  ▪ Flaws in interpretation of the outcome of the research ● The natural

Primary Task Response: Within the Discussion Board area, write 400-600

 Primary Task Response: Within the Discussion Board area, write 400-600 words that respond to the following questions with your thoughts, ideas, and comments. This will be the foundation for future discussions by your classmates. Be substantive and clear, and use examples to reinforce your ideas. Social media has become a

Think about sending a first-class letter to an international pen

Think about sending a first-class letter to an international pen pal. Describe the process that the letter goes through to get from initial creation of the letter to being read by your friend, from the letter’s perspective. Draw a behavioral state machine that depicts the states that the letter moves

For the Section 2 Discussion Board, I would like you

For the Section 2 Discussion Board, I would like you to go back to the pdf on Character in the Section 1 folder.  After you have reacquainted yourself with the terminology discussed there, I would like you to write an analysis of the characters found in the stories we have

This is a graded discussion forum. Your first message should

  This is a graded discussion forum. Your first message should be posted by Wednesday. At least 3 comments are required. The best practice is to post at the beginning, middle, and end of the week. Required: The Week 1 Discussion consists of three separate questions. You will answer one

Please answer the following 3 questions. Please use the chapter

Please answer the following 3 questions. Please use the chapter readings attached as references and cite in APA format. This is due tomorrow. In your initial response to the topic you have to answer all questions. 1. Discuss some advantages and disadvantages of using insurance to deal with health-related risks.

Tinglesa is a supermarket chain that wants to open its

   Tinglesa is a supermarket chain that wants to open its stores in South Florida. Therefore, they must do a market analysis of their main competition. The task to do (in Excel template indicate with a cross and make a brief comment on why you think that) Tab 5 force

Research at least 2 articles and 1 video that deals

Premium Paper Help is a professional writing service that provides original papers. Our products include academic papers of varying complexity and other personalized services, along with research materials for assistance purposes only. All the materials from our website should be used with proper references.

Imagine that you have been charged with transforming the performance

 Imagine that you have been charged with transforming the performance of a team at your workplace.  Specifically, it is under-performing, and your supervisor wants the team to be high-performing within six months.  Based on the information in Chapter 18 of Organizational Behavior in Health Care and your own research develop

* Cholelithiasis *Power point -> 12-14 slides   In short summary format, include Patient/client (use initials), Age, Gender/Gender identity,

* Cholelithiasis *Power point -> 12-14 slides   In short summary format, include Patient/client (use initials), Age, Gender/Gender identity, Race/ethnicity, diagnosis, and health care setting. Explain the pathophysiology of the condition Describe the typical clinical manifestations Briefly describe the best practice medical treatment Describe the nursing intervention(s) and health education