Navigation Menu

Search code, repositories, users, issues, pull requests..., provide feedback.

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly.

To see all available qualifiers, see our documentation .

  • Notifications You must be signed in to change notification settings

Current repository contains all assignments, notes, quizzes and course materials from the "Python for Everybody Specialization" provided by Coursera and University of Michigan.

sersavn/coursera-python-for-everybody-specialization

Folders and files, repository files navigation, python for everybody specialization.

Coursera Python for Everybody specialization is offered by University of Michigan.

Specialization includes following courses:

  • Getting started with python
  • Python Data Structures
  • Using python to Access Web Data
  • Using Databases with Python
  • Capstone: Retrieving Processing and Visualizing Data with Python

Each course described above contains assignments answers, course material and might contain some notes. Some course slides seemed to awesome and entartaining for me, so I could not resist adding all of them here 😃.

Additional materials

All additional course materials also can be found here . Also here is the link to the HTML version of Charles R. Severance book.

Incredible Lecturer

Without him existing on a planet I probably would never quit civil engineering and got interest in programming at all. Professor Charles Severance, University of Michigan.

Cover

  • Python 93.6%
  • JavaScript 5.3%

assignment 6.5 python for everybody

Answered on: Tuesday 20 June , 2023 / Duration: 14 min read

Programming Language: Python , Popularity : 4/10

Solution 1:

Assignment 6.5 in Python for Everybody is about writing a program that reads a file and prints out the words in the file in alphabetical order.

To accomplish this task, we need to follow these steps:

8. Print the sorted list of words.

Here is the Python code for this program:

In this program, we first ask the user to enter the filename of the file they want to read. Then, we try to open the file using the open() function. If the file cannot be opened, we print an error message and exit the program.

Next, we create an empty list called words to store all the words in the file. We then loop through each line in the file using a for loop. For each line, we remove any trailing whitespace using the rstrip() function. We then remove any punctuation marks from the line using the translate() function and the maketrans() function from the string module. Finally, we convert all the words in the line to lowercase using the lower() function and add them to the words list using the += operator.

After we have processed all the lines in the file, we sort the words list in alphabetical order using the sort() function. Finally, we print the sorted list of words using the print() function.

Here is an example output of this program:

In this example, we have a file called words.txt that contains the following words:

The program reads this file, removes any punctuation marks, converts all the words to lowercase, and sorts them in alphabetical order. The final output is a list of all the words in the file in alphabetical order.

Solution 2:

Sure, here is the in-depth solution for assignment 6.5 Python for Everybody in Python with proper code examples and outputs:

**Assignment:**

Write code using find() and string slicing (see section 6.10) to extract the number at the end of the line below. Convert the extracted value to a floating point number and print it out.

**Solution:**

**Output:**

**Explanation:**

The find() method returns the index of the first occurrence of a substring in a string. In this case, we are looking for the index of the decimal point in the string str . The number_end variable stores the index of the decimal point.

The float() function converts a string to a floating point number. In this case, we are converting the string number to a floating point number.

The main() function calls the extract_number() function and prints the output.

I hope this helps! Let me know if you have any other questions.

Solution 3:

Assignment 6.5 in the Python for Everybody course involves writing a program that reads through a file and counts the distribution of the hour of the day for each of the messages. The program should print out the counts sorted by hour.

Here is the code that accomplishes this task:

Let's break down the code:

11. Finally, the sorted list is printed, displaying the hour and its corresponding count.

Example output for the "mbox-short.txt" file:

This output shows the distribution of the hour of the day for each message in the file.

More Articles :

Python beautifulsoup requests.

Answered on: Tuesday 20 June , 2023 / Duration: 5-10 min read

Programming Language : Python , Popularity : 9/10

pandas add days to date

Programming Language : Python , Popularity : 4/10

get index in foreach py

Programming Language : Python , Popularity : 10/10

pandas see all columns

Programming Language : Python , Popularity : 7/10

column to list pyspark

How to save python list to file.

Programming Language : Python , Popularity : 6/10

tqdm pandas apply in notebook

Name 'cross_val_score' is not defined, drop last row pandas, tkinter python may not be configured for tk.

Programming Language : Python , Popularity : 8/10

translate sentences in python

Python get file size in mb, how to talk to girls, typeerror: argument of type 'windowspath' is not iterable, django model naming convention, split string into array every n characters python, print pandas version, python randomly shuffle rows of pandas dataframe, display maximum columns pandas.

IMAGES

  1. "Python for Everybody" Chapter 5

    assignment 6.5 python for everybody

  2. 【Python for Everybody(Python Data Structures)】Week 1

    assignment 6.5 python for everybody

  3. Programming for Everybody (Getting Started with Python)

    assignment 6.5 python for everybody

  4. Python for everybody Week 6 Quiz Answer

    assignment 6.5 python for everybody

  5. [Coursera] Python for everybody 5.2 Assignment · GitHub

    assignment 6.5 python for everybody

  6. [Coursera] Python for everybody 5.2 Assignment · GitHub

    assignment 6.5 python for everybody

VIDEO

  1. Python for Everybody

  2. Coursera: Python For Everybody Complete Course Assignments Solution |Python For Everybody Assignment

  3. Python For Everybody (All the Solved Exercises

  4. Coursera Python for Everybody EP-11

  5. "Python for Everybody" Chapter 5

  6. Coursera: Python For Everybody Assignment 5.2 program solution