The error you're encountering is due to incorrect syntax in your CREATE TABLE statement. Here's the corrected version of your code:
How to write the syntaxIn the corrected code, I made two modifications:
1. Changed "Not" to "NOT" in the line `price double precision NOT NULL`. The keyword "NOT" should be capitalized.
2. Added a comma after `publisher_id int` to separate it from the next column definition.
Make sure you have a table named publisher with a primary key column named publisher_id before executing this code, as it references that table.
Read more on SQL syntax here https://brainly.com/question/27851066
#SPJ4
Need the answer ASAP plz !!!!!
When the computer translates digital information to information humans can use, it is called.
Which statement describes what this command accomplishes when inside and outside interfaces are correctly identified for NAT? ip nat inside source static tcp 192.168.1.50 80 209.165.201.1 8080 extendable A. It allows host 192.168.1.50 to access external websites using TCP port 8080. B. It allows external clients coming from public IP 209.165.201.1 to connect to a web server at 192.168.1.50. C. It allows external clients to connect to a web server hosted on 192.168.1.50. D. It represents an incorrect NAT configuration because it uses standard TCP ports.
Answer:
The answer is "Option C".
Explanation:
The NAT accurately identifies the environment and internal interfaces, and main customers can link to a 192.168.1.50 Web server. When designed for, proxies examine input and output packages. IP nat "inside source" implies to encourage an outgoing parcel emanating from an "outside" application and behave accordingly.
8.3.7: Exclamat!on Po!nts
Write the function exclamation that takes a string and then returns the same string with every lowercase i replaced with an exclamation point. Your function should:
Convert the initial string to a list
Use a for loop to go through your list element by element
Whenever you see a lowercase i, replace it with an exclamation point in the list
Return the stringified version of the list when your for loop is finished
Here’s what an example run of your program might look like:
exclamation("I like music.")
# => I l!ke mus!c.
The function is an illustration of loops.
Loop instructions are used to repeat operations
The function in Python, where comments are used to explain each line is as follows:
#This defines the function
def exclamation(myStr):
#This iterates through the string
for i in range(len(myStr)):
#This checks if the current character of the string is "i"
if myStr[i] == "i":
#If yes, this converts the string to a list
s = list(myStr)
#This replaces i with !
s[i] = '!'
#This gets the updated string
myStr = "".join(s)
#This returns the new string
return myStr
Read more about similar programs at:
https://brainly.com/question/22444309
what are the disadvantages of using a workstation as a print server
Answer:
Pros and cons of workstation
There are some pros and cons of workstation that are explained below:-
Advantages of workstation
High performance:
This type of computers can give more performance than a normal computer. It is best suited for rendering complex graphics, financial analysis, and digital content creation.
Single user:
A single user can use this type of computer at a time and hence the speed of the system can be improved and there is no other user that can interfere with the performance.
Smart investment:
Investing in such computers is good because it increases our productivity and can do more work than the normal user can do. For example, if you want to edit any animation and then render it then it can be done rapidly.
Used in the entertainment and media sector:
These computers can perform best in entertainment sector where a lot of audio and video processing is needed. Also, such computers work great in the media sector where live broadcasting is done.
Reliability:
You can easily diagnose any problem in the workstation. The IT staff can repair your system if you get a blue screen, or workstation can become unresponsive. IT staff can attach keyboard, mouse, and video and identify the problem in the workstation even the workstation is off.
Large memory:
A workstation has a larger memory than a desktop PC. It has about twice the memory as compared to laptops, tablets, smartphone or other devices. By using larger memory it can do more work in a shorter time. There are nearly no errors in memory while performing any task.
Multiple processors support:
A workstation has multiple processors attached to it. By using multiprocessors you can run multiple applications at a time without any issue. Your system will not slow down by opening multiple applications. A workstation is used by professionals like engineers, scientists, analysts and designers.
Large hard drives and SSD:
A workstation has hard drives which can store terabytes of data so any type of job of any size can be stored in the hard drives. Additionally, SSD (Solid State Drives) are also attached in the workstation to speed up the overall performance of the system.
Easy to use:
The workstation has a large keyboard than a laptop and it is easy to use if you stay in one room.
Disadvantages of workstation
Portability:
It is difficult to move workstation from one place to another. On the other hand, if you use a laptop then you can move it easily from one place to another. For moving workstation, you have to plug out every time you plan to move.
Expensive:
Workstation is expensive than low capacity computers. The higher cost is because of higher RAM, hard drives and multiprocessor support.
High power usage:
The workstation uses more electricity than other devices like tablets, smartphone, laptops and desktop computers.
Examples of workstation
Some examples of the workstation are:-
Apple Power Mac G5
Hp Z series
Dell Precision
Sun Microsystems SparcStation
Silicon Graphics IRIX Machines
Apple Mac Pro
Apple Macbook Pro
Explanation:
The 4Ps model has been challenged because it omits or underemphasizes important activities such as services. It's also been criticized for taking a seller's, rather than a buyer's, viewpoint. The more recent 4As framework complements the traditional model and includes ________. Group of answer choices adaptability, affordability, availability and awareness adaptability, affordability, accessibility and awareness acceptability, affordability, accessibility and aptitude acceptability, affordability, accessibility and awareness adaptability, affordability, availability and aptitude
Answer:
acceptability, affordability, accessibility and awareness.
Explanation:
Marketing mix can be defined as the choices about product attributes, pricing, distribution, and communication strategy that a company blends and offer its targeted markets so as to produce a desired response.
Generally, a marketing mix is made up of the four (4) Ps;
1. Products: this is typically the goods and services that gives satisfaction to the customer's needs and wants. They are either tangible or intangible items.
2. Price: this represents the amount of money a customer buying goods and services are willing to pay for it.
3. Place: this represents the areas of distribution of these goods and services for easier access by the potential customers.
4. Promotions: for a good sales record or in order to increase the number of people buying a product and taking services, it is very important to have a good marketing communication such as advertising, sales promotion, direct marketing etc.
However, the 4P's model has been challenged because it omits or underemphasizes important activities such as services. It's also been criticized for taking a seller's, rather than a buyer's, viewpoint. The more recent 4As framework complements the traditional model and includes acceptability, affordability, accessibility and awareness.
The 4As framework helps business firms or companies to see all of its activities from the perspective of the customers and as such it enhances (facilitates) customer satisfaction and creates value.
Hence, for any business to be successful in its market campaigns, it must judiciously and effectively adopt the 4As framework.
as the agile security officer for a financial company, you need to ensure that the organization's use of secure communication channels to domestic and international customers meets government export regulations. use the vulnerability assessment process flow diagram to help you identify which of the seven areas of security best apply to the scenario above. select all that apply. question 5 options: input validation: secure input and representations apis: secure api interactions cryptography: encryption use and vulnerabilities client/server: secure distributed composing code error: secure error handling code quality: secure coding practices/patterns encapsulation: secure data structures
As the agile security officer for a financial company, I need to ensure that the organization's use of secure communication channels to domestic and international customers meets government export regulations.
To identify which of the seven areas of security best apply to the scenario above, I will use the vulnerability assessment process flow diagram.
The seven areas of security are input validation, APIs, cryptography, client/server, composing code error, code quality, and encapsulation. In this scenario, I would select input validation, APIs, cryptography, client/server, and code quality.
Input validation is important in ensuring that the input received from customers is secure and free from vulnerabilities. APIs are also critical in securing communication channels, as they provide a secure way for applications to interact with each other. Cryptography is essential in encrypting sensitive data to protect it from unauthorized access. Client/server security is crucial in securing distributed communication channels, while code quality ensures secure coding practices and patterns.
Composing code error and encapsulation are not as relevant in this scenario, as they focus more on secure error handling and data structures, respectively. In summary, the use of secure communication channels to domestic and international customers in a financial company requires a comprehensive approach to security, involving input validation, APIs, cryptography, client/server, and code quality.
Learn more about communication channels here:-
https://brainly.com/question/30420548
#SPJ11
dhruv is the lead network engineer for his three-year-old company. he is writing a proposal that recommends the network protocol to use in several branch offices. based on the age of the networking equipment, what is his recommendation to the chief information officer (cio)?
Upgrading to IPv6 after Post Office Protocol (POP) and Simple Mail Transfer Protocol (SMTP) transitions are complete is correct! Maintain IPv4 Use IPX/SPX instead.
The Post Office Protocol allows a user client application to access a mailbox (maildrop) kept on a mail server across an Internet Protocol (IP) network. The protocol allows for message download and deletion operations. Post Office Protocol 3 clients establish a connection, retrieve all messages, save them on the client computer, and then delete them from the server. [2] The necessity for users with only transient Internet connections, like dial-up users, drove the creation of Post Office Protocol and associated operations. These users needed to be able to retrieve email when online and then read and edit the retrieved messages when they were offline.
Additionally, POP3 clients offer the choice to leave downloaded messages on the server.
Learn more about Post Office Protocol here
https://brainly.com/question/14009005
#SPJ4
Create a flowchart that will accept 10 whole numbers one at a time and print the highest and the lowest. Use Switch.
I will create a sequence of steps that would accept 10 whole numbers one at a time and print the highest and the lowest in Java:
Import javax.swing.JOptionPane;
public class loop_exer2 {
public static void main(String agrs[])
{ String input; int trial=10, sc=0, h=0, l=0, test=0;
System.out.print("Scores: ");
for (int ctr=1;ctr<=10;ctr ) {
input=JOptionPane.showInputDialog("Enter the Scores [" trial "] trials "); sc=Integer.valueOf(input); System.out.print(sc ", ");
if(test==0){h=sc;l=sc;test=1;}
if(sc>h){h=sc;}
else if(sc>h){
h=sc; {
else if(sc<1) {
l=sc;
}
JOptionPane.showMessageDialog (null, "Highest score is:" h "Lowest score is:" l);
System.out.println();
System.out.println ("Highest score is: " h);
System.out.println ( "Lowest score is: "l);
}
}
What is a Flowchart?This refers to a diagram which is used to represent the various steps which a system uses to create a step by step solution.
From the above code, there is the command to accept whole numbers in String and then request for them one at a time and after the computation, display the highest and lowest numbers.
Read more about flowcharts here:
https://brainly.com/question/6532130
yall like portal 1 or 2
Answer:
i like both, but i personally like portal 2 the most.
Explanation:
Question 1-4
Java, Visual Basic, Python and C++ are examples of what type of programming language?
Answer:
most useful at the system level (interacting with the operating system), like C.
Explanation:
Others are most useful at the system level (interacting with the operating system), like C. There are also high level languages used to create application programs. Such languages include C#, Java, C++, PHP, Visual Basic, Python, Ruby, Perl, JavaScript and others.
(1) describe how you generally use your cellphone on a daily basis (including with whom do you communicate for what purpose with what frequency); (2) read the Supplementary Reading (click here: Does the Internet Make You More or Less Connected?), and discuss how YOUR cellphone use make YOU more or less connected.
Brainly wasn't letting me answer, so here's an attachment of the answer
what do you use to separate arguments in a function?
Answer:
Comma (,)
Explanation:
In a function header/call when we take more than one arguments then we have to use commas in order to separate them
Example
\(\tt def\:Hello(a,b):\)
Arguments are of three types
Keyword/Named Argumentpositional argumentDefault argumentsDon't Answer If You Are Going To Give Me a Link! DON'T WASTE MY POINTS!
Painters and photographers have many things in common. They both use the elements of art and principles of design to compose strong visual images. What is one other way that painters and photographers are similar?
A.
They both work with digital materials.
B.
They both capture action shots.
C.
They both use camera equipment.
D.
They both pose their subjects.
Answer:
B but don't be surprised if it is not the answer given. It's just the best of a bunch of poor choices.
Explanation:
This is actually not an easy question to answer. It's one of those answers that has elements of "Some do and Some don't" in them.
A: is not true for painters and it is not necessarily true for C for painters.
D: photographer can pose his subjects. A painter can pose someone, but not always.
C: Answered under A.
I think the answer you are forced to choose is B, but neither one has to do it. Still life painters ( a bowl of fruit, a bouquet of flowers) and photographs pose the subjects carefully and do not want the fruit or flowers to move around.
I'd pick B, but it does not have to be the answer. I just think it is less wrong than the others.
User can fill numbers in a column by using _______ command, ________ is a built-in formula in Excel to do calculations, Entering data into a cell means to _______ data into a cell, The MIN function displays the ________ value in a given list of values
Answer:
The answer to this question is given below in the explanation section.
Explanation:
This question is about fill-in-the-blank. The correct options in these fill-in-the-blanks are given below:
User can fill numbers in a column by using Down, Right, Up, Left, Series and Justify command
You can use these commands to fill numbers in columns. You can find these commands in the HOME tab under the Editing group of commands.
AutoSum is a built-in formula in Excel to do calculations
Autosum is a built-in formula that helps you to perform calculations, such as to calculate sum, average, and to find the minimum and maximum value. You can find the AutoSum command in the Home tab under the Editing group of commands.
Entering data into a cell means to put/insert data into a cell.
The MIN function displays the minimum value in a given list of values.
You use the MIN() function to display the minimum value in a given list of values or in the columns.
pls help help me is good help me helping is very good
Answer:
-56 negative
Explanation:
you are running out of time and budget for your game development project you had great ideas for making a randomized highly customizable game experience with high levels of emerg but now you can only fit in the features of one of those qualities highly immersive highly randomize or highly customized briefly describe your imaginary games style then explain which of these three qualities would be best to implement in that type of game on a limited budget
My games style in terms of their qualities will be made up of:
Movement from Attack to Defense.Set up Defense.Movement from Defense to Attack. Set Pieces. What is a game style?Game style is known to be a term that is made or used by coaches, sports scientists, etc., to show the patterns of play in a scenario of team sports.
Therefore, My games style in terms of their qualities will be made up of:
Movement from Attack to Defense.Set up Defense.Movement from Defense to Attack. Set Pieces.Learn more about Games from
https://brainly.com/question/5144258
#SPJ1
please tell me what I did incorrect
40 points
please
i really need it
you put a semi colon in your inputs
if you liked this response, please rate thanks and award brainliest
hope this helped :)
for this assignment, you will make a program that calculates a student’s final grade in cse 1321l using this weighted average system
To calculate a student's final grade in CSE 1321L using a weighted average system, you will need to follow these steps:
1. Determine the weightage of each component: Find out the percentage weight assigned to each component of the course, such as exams, homework, projects, and participation.
2. Convert the weightage to decimal: Divide the weightage of each component by 100 to convert it to decimal form. For example, if exams are weighted at 30%, you would convert it to 0.30.
3. Gather the scores: Collect the student's scores for each component of the course, such as exam scores, homework grades, project marks, and participation points.
4. Calculate the weighted scores: Multiply each component score by its corresponding weightage. For example, if the student scored 90% on exams and the weightage for exams is 0.30, you would multiply 90% by 0.30 to get the weighted exam score.
5. Sum up the weighted scores: Add up all the weighted scores obtained in the previous step. This will give you the total weighted score.
6. Main answer: Divide the total weighted score by the sum of all the weightages to obtain the final grade. Multiply this value by 100 to get the percentage.
7. The final grade in CSE 1321L using this weighted average system can be determined by dividing the total weighted score by the sum of the weightages and multiplying by 100. This calculation considers the weight assigned to each component of the course, resulting in a comprehensive evaluation of the student's performance.
To know more about percentage :
brainly.com/question/32197511
#SPJ11
Which of the following statements about malware are accurate? Select 2 options.
There are just two types of malware: viruses and worms.
pls help anyone
The purpose of malware is always to steal money.
Malware does not target mobile devices.
Malware is a type of cyberthreat that attempts to intentionally attack a system.
In 2019, malware collectively cost individuals and organizations 2 trillion dollars a year.
Answer:
4,5
Explanation:
Those to describe what malaware is
The statements about malware that are accurate:
Malware is a type of cyberthreat that attempts to intentionally attack a system. In 2019, malware collectively cost individuals and organizations 2 trillion dollars a year.What Is Malware?Malware attacks is known to be a type of attack to a system that tends to crack weak passwords, bore through the systems, spread via networks, and also disrupt the day to day operations of business.
There are different types of malware that can lock up important files, spam a person with ads, slow down your computer and others. Note that Malware as a type of cyberthreat often tries to deliberately attack a system.
Learn more about Malware from
https://brainly.com/question/399317
unsupervised data mining requires no knowledge of the target variablemon applications of unsupervised learning include: select all that apply!
Unsupervised data mining requires no knowledge of the target variablemon applications of unsupervised learning include:
ClusteringDimensionality ReductionAnomaly DetectionAssociation Rule LearningOutlier DetectionClustering ValidationWhat is Unsupervised data mining?
Unsupervised data mining is a type of machine learning that involves analyzing and discovering patterns or structures in data without any prior knowledge of a target variable or outcome variable. In other words, unsupervised learning is used when we don't have a pre-defined label or target variable to predict, but we still want to extract insights or discover hidden patterns from the data.
Unsupervised data mining requires no knowledge of the target variablemon applications of unsupervised learning include:
Clustering: grouping data points into similar clusters or segments based on their features or patterns, with the aim of discovering hidden structures or relationships in the data.Dimensionality Reduction: reducing the number of features or variables in a dataset, while preserving as much of the original information as possible, in order to simplify analysis or visualization tasks, or to improve model performance.Anomaly Detection: identifying data points or instances that deviate significantly from the norm or expected behavior, and may indicate errors, fraud, or unusual events.Association Rule Learning: discovering frequent co-occurrences or patterns of items in a dataset, such as in market basket analysis or recommendation systems.Outlier Detection: identifying data points or instances that are significantly different from the rest of the data, and may indicate rare events or errors in measurement.Clustering Validation: evaluating the quality or coherence of the clustering results, and selecting the best number of clusters or the most appropriate clustering algorithm.Learn more about Unsupervised data mining click here:
https://brainly.com/question/29766531
#SPJ4
How do I create a call sheet template?
Depending on the production these are used for, call sheets can range in length from one page until twenty pages.
What does the word "template" mean?
It is a word change from templet that had been influenced by plate. The word "templet" may be derived in a French word for a loom's component, although its true origin is uncertain.
There are virtually endless applications for the word template. A template is anything that acts as a guide for creating something.A document that has already been created and has some formatting is called a template.
To format a document quickly and efficiently, use a template's formatting rather than starting from scratch. You can make your own template, use one that comes with Word, or download one from the web.
To know more about template visit:
brainly.com/question/28626946
#SPJ4
which of the following is an example of emotion-focused coping? group of answer choices studying for your exam early and often taking a walk to calm down after fighting with your friend. divorcing your spouse because they cheated on you. quitting your job because of the toxic work environment
The example of emotion-focused coping is quitting your job because of the toxic work environment. The correct option is 4.
What is emotion-focused coping?One of the primary coping strategies is emotion-focused coping, which has the ability to control (tolerate, lessen, or eliminate) the physiological, emotional, cognitive, and behavioural reactions that come along with experiencing stressful interactions.
Instead of solving the issue, emotion-focused coping emphasises managing your feelings and your reaction to it.
An illustration of an emotion-focused coping strategy is quitting your job due to a toxic workplace.
Thus, the correct option is 4.
For more details regarding emotion-focused coping, visit:
https://brainly.com/question/29914904
#SPJ1
Discuss the advantages and disadvantages of telecommuting and
having a virtual office.
Telecommuting and having a virtual office are becoming increasingly popular in the modern workplace. Telecommuting refers to working from home or a remote location, while a virtual office refers to a virtual workspace where employees can access necessary tools and resources online.
Both options have advantages and disadvantages, as discussed below.
Advantages of TelecommutingFlexibility:
Telecommuting allows employees to work from anywhere, giving them greater flexibility to balance work and personal responsibilities. Cost Savings: Employees who telecommute save money on transportation costs and other expenses associated with working in a traditional office.
Improved Productivity:
Telecommuting allows employees to work in a comfortable environment free from office distractions, leading to increased productivity.
Disadvantages of TelecommutingSocial Isolation:
Working from home can lead to social isolation, as employees may miss out on the social interactions that come with working in an office.
Limited Communication:
Telecommuting may result in limited communication with colleagues and managers, which can lead to misunderstandings and missed opportunities.
Technology Issues:
Telecommuting requires reliable technology and a strong internet connection, which can be problematic in areas with poor connectivity.
Advantages of a Virtual OfficeCost Savings:
A virtual office eliminates the need for a physical office, saving money on rent, utilities, and other expenses.
Flexibility: A virtual office allows employees to work from anywhere, giving them greater flexibility to balance work and personal responsibilities.
Improved Productivity: A virtual office eliminates the distractions associated with a traditional office, leading to increased productivity.Disadvantages of a Virtual Office.
Social Isolation: A virtual office can lead to social isolation, as employees may miss out on the social interactions that come with working in an office.
Limited Communication: A virtual office may result in limited communication with colleagues and managers, which can lead to misunderstandings and missed opportunities.
Technology Issues: A virtual office requires reliable technology and a strong internet connection, which can be problematic in areas with poor connectivity.
Overall, both telecommuting and having a virtual office have advantages and disadvantages. While they offer greater flexibility and cost savings, they may lead to social isolation and limited communication. Employers must consider these factors when deciding whether to implement telecommuting or a virtual office in their workplace.
To learn about telecommuting here:
https://brainly.com/question/29645344
#SPJ11
When creating an html document, what do we use to set aside space for content?.
AnswerTags:
Explanation:
Almost half of the people in the world are on social media, and predictions Indicate that this number will only continue to increase. What conclusion can you draw from this?
a. social media is passing phase in most cultures
b. social media will eventually replace all other forms of communication
c. social media will need to develop more kinds of platforms to be popular
d. social media platforms will become an increasingly important part of communication
Answer:
social media will eventually replace all other forms of communication
Write a program to compute an employee's weekly pay and produce a pay slip showing name, gross, pay, deductions, and net pay. The program should first prompt the user for: a. Family name b. Given name c. Hourly rate of pay d. Number of hours worked that week (Any hours over 40 are paid at double the normal hourly rate) e. A letter indicating the employee's tax category A. No tax deduction B. Tax is 10% of gross pay C. Tax is 20% of gross pay D. Tax is 29% of gross pay E. Tax is 35% of gross pay f. Either a Y or an N to indicate whether or not the employee wants $20 deducted from the weekly pay as a contribution to the United Way Charity
Answer:
# get the employee data
family_name = input("Enter family name: ")
given_name = input("Enter given name: ")
hourly_rate = int(input("Enter hourly rate of pay: "))
hours = int(input("Enter hours worked for the week: "))
tax_cat = input("Enter tax category from a through e: ")
is_charit = input("Do you want to donate $20 to charity y/n: ")
gross_pay = 0
net_pay = 0
deductions = ""
# gross_pay
if hours > 40:
gross_pay = hours * (2 * hourly_rate)
else:
gross_pay = hours * hourly_rate
# net_pay and deduction
if tax_cat == 'a':
if is_charit == 'y':
net_pay = gross_pay - 20
deduction = "$20 charity donation"
else:
net_pay = gross_pay
deduction = "0% tax"
elif tax_cat == 'b':
if is_charit == 'y':
net_pay = gross_pay - ( 0.1 * gross_pay) - 20
deduction = "$20 charity donation and 10% tax"
else:
net_pay = gross_pay - (0.1 * gross_pay)
deduction = "10% tax"
elif tax_cat == 'c':
if is_charit == 'y':
net_pay = gross_pay - ( 0.2 * gross_pay) - 20
deduction = "$20 charity donation and 20% tax"
else:
net_pay = gross_pay - (0.2 * gross_pay)
deduction = "20% tax"
elif tax_cat == 'd':
if is_charit == 'y':
net_pay = gross_pay - ( 0.29 * gross_pay) - 20
deduction = "$20 charity donation and 29% tax"
else:
net_pay = gross_pay - (0.29 * gross_pay)
deduction = "29% tax"
if tax_cat == 'e':
if is_charit == 'y':
net_pay = gross_pay - ( 0.35 * gross_pay) - 20
deduction = "$20 charity donation and 35% tax"
else:
net_pay = gross_pay - (0.35 * gross_pay)
deduction = "35% tax"
# output of the employee's weekly pay.
print(f"Employee name: {given_name} {family_name}")
print(f"Gross pay: ${gross_pay}")
print(f"Net pay: {net_pay}")
print(f"Deductions: {deduction}")
Explanation:
The python program uses the input built-in function to prompt and get user data for the program. The gross pay returns the total pay of the employee without any deduction while net pay returns the pay with all deductions included.
what is memory?
How many type of memory in computer system?
Memory is the process of taking in information from the world around us, processing it, storing it and later recalling that information, sometimes many years later. Human memory is often likened to that of a computer memory.
How many type of memory in computer system?two typesMemory is also used by a computer's operating system, hardware and software. There are technically two types of computer memory: primary and secondary. The term memory is used as a synonym for primary memory or as an abbreviation for a specific type of primary memory called random access memory (RAM).Hope it helps you my friendHave a great day aheadGood morning friendOur first task will be to extract the text data that we are interested in. Take a moment and review the file synthetic.txt.
You will have noticed there are 17 lines in total. But only the subset of data between the lines *** START OF SYNTHETIC TEST CASE *** and *** END OF SYNTHETIC TEST CASE *** are to be processed.
Each of the files provided to you has a section defined like this. Specifically:
The string "*** START OF" indicates the beginning of the region of interest
The string "*** END" indicates the end of the region of interest for that file
Write a function, get_words_from_file(filename), that returns a list of lower case words that are within the region of interest.
The professor wants every word in the text file, but, does not want any of the punctuation.
They share with you a regular expression: "[a-z]+[-'][a-z]+|[a-z]+[']?|[a-z]+", that finds all words that meet this definition.
Here is an example of using this regular expression to process a single line:
import re
line = "james' words included hypen-words!"
words_on_line = re.findall("[a-z]+[-'][a-z]+|[a-z]+[']?|[a-z]+", line)
print(words_on_line)
You don't need to understand how this regular expression works. You just need to work out how to integrate it into your solution.
Feel free to write helper functions as you see fit but remember these will need to be included in your answer to this question and subsequent questions.
We have used books that were encoded in UTF-8 and this means you will need to use the optional encoding parameter when opening files for reading. That is your open file call should look like open(filename, encoding='utf-8'). This will be especially helpful if your operating system doesn't set Python's default encoding to UTF-8.
For example:
Test Result
filename = "abc.txt"
words2 = get_words_from_file(filename)
print(filename, "loaded ok.")
print("{} valid words found.".format(len(words2)))
print("Valid word list:")
print("\n".join(words2))
abc.txt loaded ok.
3 valid words found.
Valid word list:
a
ba
bac
filename = "synthetic.txt"
words = get_words_from_file(filename)
print(filename, "loaded ok.")
print("{} valid words found.".format(len(words)))
print("Valid word list:")
for word in words:
print(word)
synthetic.txt loaded ok.
73 valid words found.
Valid word list:
toby's
code
was
rather
interesting
it
had
the
following
issues
short
meaningless
identifiers
such
as
n
and
n
deep
complicated
nesting
a
doc-string
drought
very
long
rambling
and
unfocused
functions
not
enough
spacing
between
functions
inconsistent
spacing
before
and
after
operators
just
like
this
here
boy
was
he
going
to
get
a
low
style
mark
let's
hope
he
asks
his
friend
bob
to
help
him
bring
his
code
up
to
an
acceptable
level
Here is a helper function called get words from file(filename) that returns a list of lowercase words from the text data that we're interested in by using the regular expression that we are given by the professor: import re def get words from file(filename):
start = '*** START OF SYNTHETIC TEST CASE ***'
end
= '*** END OF SYNTHETIC TEST CASE ***'
words
= [] found
= False with open(filename, encoding='utf-8') as f: for line in f: line = line. strip() if not found and start in line: found
= True continue elif found and end in line: break elif found: words on line
= re. find all ("[a-z]+[-'][a-z]+|[a-z]+[']?|[a-z]+", line.
lower()) words. extend(words on line) return words You can use the above-written code to find the words in the file synthetic.txt within the range specified by the professor.
To know more about lowercase visit:
https://brainly.com/question/30765809
#SPJ11
An all-in-one printer is also known as a multi-function printer. It includes a printer, scanner, copy machine and / or fax machine.true or false?
An all-in-one printer is also known as a multi-function printer. It includes a printer, scanner, copy machine and / or fax machine: true.
What is a printer?In Computer technology, a printer can be defined as an electronic output (peripheral) device that is designed and developed for printing paper documents containing texts or images.
What is an all-in-one printer?An all-in-one printer is sometimes referred to as multifunction peripheral or multi-function printer and it can be defined as a type of printer that is designed and developed to comprise all or some of the following;
PrinterScannerCopy machineFax machine.Read more on printer here: brainly.com/question/17100575
#SPJ1