Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The sample script named noMoreErrors.py currently contains five errors. Modify the script to remove all errors. As you remove errors, note whether the error resulted

The sample script named noMoreErrors.py currently contains five errors. Modify the script to remove all errors. As you remove errors, note whether the error resulted in a feedback bar message or a traceback message and note the message. Modify the last five lines of the script to report the error messages you encountered. The first two of these have been completed for you already. When the script is repaired, the first portion of the output will look like this:

NoMoreErrors.py b Mucca.gdb Dyer20

DYER #1. FEEDBACK BAR: Failed to check - syntax error - EOL while scanning string literal #2. TRACEBACK: IndexError: string index out of range

Error messages for #35 will also be printed, when the script is complete, but they are omitted here.

code:

# Name: NoMoreErrors.py

dataName = 'Lucca.gdb'

county = 'Dyer'

id = 20

# 1. Print the name of the script.

print 'NoMoreErrors.py

# 2. Print the last chararcter in dataName

print dataName[11]

# 3. Use a string method to change the first letter

# of dataName to M ('Mucca.gdb' not 'Lucca.gdb')

# and print the results

dataName[0] = 'M'

print dataName

# 4. Concatenate county and id and print the results

fullName = county + id

print fullName

# 5. Print the county in all caps.

allCaps = county.upper(0)

print allCaps

# 6. Print the feedback message or the last line of the traceback resulting

# from each erroroneous line in #1-5 before each was repaired. #1 and 2 are

# done for you.

print '#1. FEEDBACK BAR: Failed to check - syntax error - EOL while scanning string literal'

print '#2. TRACEBACK: IndexError: string index out of range'

print "#3. TRACEBACK: ???"

print "#4. TRACEBACK: ???"

print '#5. TRACEBACK: ???'

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing Fundamentals Design And Implementation

Authors: KROENKE DAVID M.

1st Edition

8120322258, 978-8120322257

More Books

Students also viewed these Databases questions

Question

Describe the movements permitted by the elbow joint.

Answered: 1 week ago

Question

8. Explain the difference between translation and interpretation.

Answered: 1 week ago

Question

10. Discuss the complexities of language policies.

Answered: 1 week ago

Question

1. Understand how verbal and nonverbal communication differ.

Answered: 1 week ago