- Using Python to Access Web Data Quiz Answers – Networking Funda
- Using Python to Access Web Data Week 1 Quiz Answers
- Quiz: Regular Expressions
- Using Python to Access Web Data Week 2 Quiz Answers
- Quiz: Networks and Sockets
- Saved searches
- Use saved searches to filter your results more quickly
- ritulsingh/Using-Python-to-Access-Web-Data
- Name already in use
- Sign In Required
- Launching GitHub Desktop
- Launching GitHub Desktop
- Launching Xcode
- Launching Visual Studio Code
- Latest commit
- Git stats
- Files
- README.md
- About
- Saved searches
- Use saved searches to filter your results more quickly
- AlexGascon/Using-Python-to-Access-Web-Data—Coursera
- Name already in use
- Sign In Required
- Launching GitHub Desktop
- Launching GitHub Desktop
- Launching Xcode
- Launching Visual Studio Code
- Latest commit
- Git stats
- Files
- README.md
- About
Using Python to Access Web Data Quiz Answers – Networking Funda
Using Python to Access Web Data Week 1 Quiz Answers
Quiz: Regular Expressions
- The way Python handles and recovers from errors that would otherwise cause a traceback
- A way to calculate mathematical values paying attention to operator precedence
- A way to solve Algebra formulas for the unknown value
- A small programming language unto itself
- correcr answer ^
- str.startswith()
- \linestart
- String.startsWith()
- variable[0:1]
Q3. What would the following mean in a regular expression? [a-z0-9]
- Match anything but a lowercase letter or digit
- Match a lowercase letter or a digit
- Match any number of lowercase letters followed by any number of digits
- Match an entire line as long as it is lowercase letters or digits
- Match any text that is surrounded by square braces
Q4. What is the type of the return value of the re.findall() method?
- A boolean
- A single character
- An integer
- A list of strings
- A string
- The “+” matches at least one character and the “*” matches zero or more characters
- The “+” matches upper case characters and the “*” matches lowercase characters
- The “+” matches the beginning of a line and the “*” matches the end of a line
- The “+” matches the actual plus character and the “*” matches any character
- The “+” indicates “start of extraction” and the “*” indicates the “end of extraction”
- Any number of digits at the beginning of a line
- One or more digits
- Zero or more digits
- Any mathematical expression
- Several digits followed by a plus sign
Q8. What does the following Python sequence print out?
x = ‘From: Using the : character’
Q9. What character do you add to the “+” or “*” to indicate that the match is to be done in a non-greedy manner?
Q10. Given the following line of text:
From stephen.marquard@uct.ac.za Sat Jan 5 09:14:16 2008
- From
- d@uct.ac.za
- \@\
- marquard@uct
- stephen.marquard@uct.ac.za
Using Python to Access Web Data Week 2 Quiz Answers
Quiz: Networks and Sockets
- SMTP
- DECNET
- The Request/Response Cycle
- Internet Protocol (IP)
- IMAP
- A blank line
- A less-than sign indicating the start of an HTML tag
- Four dashes
- X-End-Header: true
- import tcp-socket
- open socket
- import tcp
- _socket = true
- import socket
Q4. In a client-server application on the web using sockets, which must come up first?
- An “in-progress” phone conversation
- Fiber optic cables
- The wheels on an automobile
- The chain on a bicycle
- The ringer on a telephone
- HyperText
- wHolsitic
- Simple
- Hyperspeed
- Manual
- How long do we wait before packets are retransmitted?
- What is the IP address for a domain like www.dr-chuck.com?
- How much memory does the server need to serve requests?
- Which application talks first? The client or server?
Q8. What are the three parts of this URL (Uniform Resource Locator)?
Saved searches
Use saved searches to filter your results more quickly
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.
This is a repository all about the solution of «Using Python to Access Web Data» in the Coursera assignment.
ritulsingh/Using-Python-to-Access-Web-Data
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Sign In Required
Please sign in to use Codespaces.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
Latest commit
Git stats
Files
Failed to load latest commit information.
README.md
This is repository all about the solution of «Using Python to Access Web Data » in coursera assignment.
Week 2 Finding Numbers in a Haystack
In this assignment you will read through and parse a file with text and numbers. You will extract all the numbers in the file and compute the sum of the numbers.
Data Files We provide two files for this assignment. One is a sample file where we give you the sum for your testing and the other is the actual data you need to process for the assignment.
Sample data: http://py4e-data.dr-chuck.net/regex_sum_42.txt (There are 90 values with a sum=445833)
Actual data: http://py4e-data.dr-chuck.net/regex_sum_383952.txt (There are 84 values and the sum ends with 667)
These links open in a new window. Make sure to save the file into the same folder as you will be writing your Python program. Note: Each student will have a distinct data file for the assignment — so only use your own data file for analysis.
The file contains much of the text from the introduction of the textbook except that random numbers are inserted throughout the text. Here is a sample of the output you might see:
The sum for the sample text above is 27486. The numbers can appear anywhere in the line. There can be any number of numbers in each line (including none).
Handling The Data The basic outline of this problem is to read the file, look for integers using the re.findall(), looking for a regular expression of ‘9+’ and then converting the extracted strings to integers and summing up the integers.
Week 3 Exploring the HyperText Transport Protocol
You are to retrieve the following document using the HTTP protocol in a way that you can examine the HTTP Response headers.
http://data.pr4e.org/intro-short.txt There are three ways that you might retrieve this web page and look at the response headers:
Preferred: Make sure to change the code to retrieve the above URL — the values are different for each URL. Open the URL in a web browser with a developer console or FireBug and manually examine the headers that are returned. Use the telnet program as shown in lecture to retrieve the headers and content. Enter the header values in each of the fields below and press «Submit».
Last-Modified: Sat, 13 May 2017 11:22:22 GMT
Cache-Control: max-age=0, no-cache, no-store, must-revalidate
Week 4 Scraping Numbers from HTML using BeautifulSoup
In this assignment you will write a Python program similar to http://www.py4e.com/code3/urllink2.py. The program will use urllib to read the HTML from the data files below, and parse the data, extracting numbers and compute the sum of the numbers in the file.
We provide two files for this assignment. One is a sample file where we give you the sum for your testing and the other is the actual data you need to process for the assignment.
You do not need to save these files to your folder since your program will read the data directly from the URL. Note: Each student will have a distinct data url for the assignment — so only use your own data url for analysis.
Week 5 Extracting Data from XML
In this assignment you will write a Python program somewhat similar to http://www.py4e.com/code3/geoxml.py. The program will prompt for a URL, read the XML data from that URL using urllib and then parse and extract the comment counts from the XML data, compute the sum of the numbers in the file.
We provide two files for this assignment. One is a sample file where we give you the sum for your testing and the other is the actual data you need to process for the assignment.
You do not need to save these files to your folder since your program will read the data directly from the URL. Note: Each student will have a distinct data url for the assignment — so only use your own data url for analysis.
Week 6 Extracting Data from JSON
In this assignment you will write a Python program somewhat similar to http://www.py4e.com/code3/json2.py. The program will prompt for a URL, read the JSON data from that URL using urllib and then parse and extract the comment counts from the JSON data, compute the sum of the numbers in the file and enter the sum below: We provide two files for this assignment. One is a sample file where we give you the sum for your testing and the other is the actual data you need to process for the assignment.
You do not need to save these files to your folder since your program will read the data directly from the URL. Note: Each student will have a distinct data url for the assignment — so only use your own data url for analysis.
About
This is a repository all about the solution of «Using Python to Access Web Data» in the Coursera assignment.
Saved searches
Use saved searches to filter your results more quickly
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.
Repository containing the programming exercises coded during the course «Using Python to Access Web Data», from University of Michigan and offered in Coursera
AlexGascon/Using-Python-to-Access-Web-Data—Coursera
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Sign In Required
Please sign in to use Codespaces.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
Latest commit
Git stats
Files
Failed to load latest commit information.
README.md
#Introduction This repository contains the resources and materials I’ve generated myself during the course «Using Python to Access Web Data», from University of Michigan and offered in Coursera
#Content available Currently, the only content available are the Python files corresponding to the programming assignments I’ve coded for the course. I plan on making available also documents with my notes from the course, but I’m still finishing them
#Folder structure The content follows the same structure than the course: there’s a folder for each of the weeks the course is structured in, and them contains all the material from that week. There are two types of files: the ones that start with «C» are the coding files containing the exercises, while the ones that start with «A» are other resources used on or obtained as a result from the assignments. The other two numbers represent the unit and the index of that document within the type+week respectively.
Example: the file starting with C4.2. is the 2nd coding file needed for the programming assignment used on Unit 4
About
Repository containing the programming exercises coded during the course «Using Python to Access Web Data», from University of Michigan and offered in Coursera