What is the error and how to fix it
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
What is the error and how to fix it
![urce Run Debug Consoles Projects Tools View Help
日回 CMnea> ■
C\UserslosamalOneDrive\DesktoplOsama squlosamelpython\assginmnets
tve\Desktop\Osama squlosama\python\assginmnetW44.py
Name
Туре
Size
Value
aild_letter= ['A','AA', 'AB', 'AD', 'AR', 'AN', 'AN', "AY',
BA', 'BB','BD','BR', 'BM', 'BW', 'BY',
DA', 'DD', 'DR', 'DW', 'DY'
RA', 'RR','RM', 'RW', 'RY',
File1
TextIOWrapper 1
TextIOWrapper object of _io module
inputs
['12 A
, '123 BB
11st
line
Int
MA', 'MB', 'MM', 'MW', "MY',
"WA', "WB', 'WW',
"YA', 'YB','YD', "YR', 'YW', 'YY']
the vaild_letter list
['A', "AA", "AB", "AD, "AR', 'AM, "Aw', "AY', '8, 1
47
=1
i in input:
try:
x,y =
- i. split
if x[0]=="0":
try:
File3.write(x + " " + y + "In")
except IOError:
Variable explorer Help Plots Files
print("File Write Error : [Errno 13] Permission Denied : 'invalid. txt"")
O Console 7/A
elif int(x) > 99999:
try:
File3.write(x +""+ y + "In")
Python 3.7.6 (default, Jan 8 2020, 20:23:39) [MSC v.1916 64 bit (AMD64)]
Type "copyright", "credits" or "license" for more information.
except IOError:
print("File Write Error : [Errno 13] Permission Denied : 'invalid. txt")
IPython 7.12.0 -- An enhanced Interactive Python.
elif y not in the_vaild_letter:
try:
File3.write(x + "" + y + "\n")
In [1]: runfile( 'C:/Users/osama/OneDrive/Desktop/Osama squ/osama/python/assginmnet4/H4
wdir='C:/Users/osama/OneDrive/Desktop/Osama squ/osama/python/assginmnet4')
Traceback (most recent call last):
except IOError:
print("File Write Error : [Errno 13] Permission Denied : 'inalid. txt'")
File "C:\Users losama\OneDrive\Desktop\Osama squ\osama\python\assginmnet4\H44.py", lin
in <module>
for i in input:
else:
try:
File2.write(x + "" + y + "\n")
TypeError: 'method' object is not iterable
except IOError:
print("File Write Error : (Errno 13] Permission Denied : 'valid, txt")
I
except ValueError:
print("Parse Error e Line number "+str(line)+" need more than 1 value to unpack:", i)
In (2):
line +s 1
IPython console History
* Kite: ready
O conda: base (Python 3.7.6)
Line 28, Col 15
UTFS
CRLF
RW](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Ffda25008-6811-4f3a-896c-3b0e49712a6d%2F03e47961-f3fd-40d3-b939-562da6abec3c%2F0xbmsal_processed.jpeg&w=3840&q=75)
Transcribed Image Text:urce Run Debug Consoles Projects Tools View Help
日回 CMnea> ■
C\UserslosamalOneDrive\DesktoplOsama squlosamelpython\assginmnets
tve\Desktop\Osama squlosama\python\assginmnetW44.py
Name
Туре
Size
Value
aild_letter= ['A','AA', 'AB', 'AD', 'AR', 'AN', 'AN', "AY',
BA', 'BB','BD','BR', 'BM', 'BW', 'BY',
DA', 'DD', 'DR', 'DW', 'DY'
RA', 'RR','RM', 'RW', 'RY',
File1
TextIOWrapper 1
TextIOWrapper object of _io module
inputs
['12 A
, '123 BB
11st
line
Int
MA', 'MB', 'MM', 'MW', "MY',
"WA', "WB', 'WW',
"YA', 'YB','YD', "YR', 'YW', 'YY']
the vaild_letter list
['A', "AA", "AB", "AD, "AR', 'AM, "Aw', "AY', '8, 1
47
=1
i in input:
try:
x,y =
- i. split
if x[0]=="0":
try:
File3.write(x + " " + y + "In")
except IOError:
Variable explorer Help Plots Files
print("File Write Error : [Errno 13] Permission Denied : 'invalid. txt"")
O Console 7/A
elif int(x) > 99999:
try:
File3.write(x +""+ y + "In")
Python 3.7.6 (default, Jan 8 2020, 20:23:39) [MSC v.1916 64 bit (AMD64)]
Type "copyright", "credits" or "license" for more information.
except IOError:
print("File Write Error : [Errno 13] Permission Denied : 'invalid. txt")
IPython 7.12.0 -- An enhanced Interactive Python.
elif y not in the_vaild_letter:
try:
File3.write(x + "" + y + "\n")
In [1]: runfile( 'C:/Users/osama/OneDrive/Desktop/Osama squ/osama/python/assginmnet4/H4
wdir='C:/Users/osama/OneDrive/Desktop/Osama squ/osama/python/assginmnet4')
Traceback (most recent call last):
except IOError:
print("File Write Error : [Errno 13] Permission Denied : 'inalid. txt'")
File "C:\Users losama\OneDrive\Desktop\Osama squ\osama\python\assginmnet4\H44.py", lin
in <module>
for i in input:
else:
try:
File2.write(x + "" + y + "\n")
TypeError: 'method' object is not iterable
except IOError:
print("File Write Error : (Errno 13] Permission Denied : 'valid, txt")
I
except ValueError:
print("Parse Error e Line number "+str(line)+" need more than 1 value to unpack:", i)
In (2):
line +s 1
IPython console History
* Kite: ready
O conda: base (Python 3.7.6)
Line 28, Col 15
UTFS
CRLF
RW
![,"MB', 'MM", "A", 'MY',
(Python 3.7)
Search Source Run Debug Consoles Projects Tools View Help
四 @
CAUserslosamalOnebrvelDesktop1Osama squiosama\python\assginmnete
osamalOneDrive\Desktop\Osama squ\osama\python\assginmnetHW4.py
4 B , a o
4.py
Name
Туре
Size
Value
File1
TextIOWrapper 1
TextIOWrapper object of _1o nodule
Qauthor: osama
['12 A
, '123 B8
inputs
1ist
inputs""
try:
Filel- open("plates. txt", "r")
inputs-Filei.readlines()
except IOError:
line
Int
1
the veild letter list
['A', "AA', 'AB', 'AD', AR',
, "AM', 'AY', 8, BA, ...)
47
print("File Read Error : [Errno 2] No such file or directory : 'plates.txt")
File2- open ("valid. txt", "a")
6
File3e open("invalid. txt", "a")
18 - the_vaild letter- ['A', 'AA', 'AB', 'AD', "AR', "AM', "AW', 'AY',
19
20
'B', 'BA', "BB', 'BD', 'BR', 'BM", 'BW', "BY',
'D', 'DA', 'DD', 'DR', 'DW", "DY",
'R', 'RA', 'RR', 'RM', 'RW', 'RY
'S','SS
'M', 'MA', 'MB", 'MM', 'MW', 'MY',
"W', 'WA', "WB', 'MW',
'Y', 'YA', "YB', 'YD', 'YR', 'YW', 'YY']
21
Variable explorer Help Plots Files
22
23
O Console 7/A X
Python 3.7.6 (default, Jan 8 2020, 20:23:39) [MSC v.1916 64 bit (AMD64)]
Type "copyright", "credits" or "license" for more information.
24
25
26
line-1
28 - for i in input
try:
27
IPython 7.12.0 -- An enhanced Interactive Python.
In [1): runfile('C:/Users/osama/OneDrive/Desktop/Osama squ/osama/python/assginmnet4/H44.py",
wdir-'C:/Users/osama/OneDrive/Desktop/Osama squ/osama/python/assginmnet4')
Traceback (most recent call last):
29
30
x,y - i. split
31
32
if x[0]=="0":
File "C:\Users\osama\OneDrive\Desktop\Osama squ\osama\python\assginmnet4\HW44.py", line 28,
in <module>
for i in input:
33
34
try:
File3.write(x +"+ y + *"\n")
-
except IOError:
print("File Write Error : [Errno 13] Perwission Denied : 'invalid. txt'")
35
36
TypeError: 'method' object is not iterable
37
38
elif int (x) > 99999:
try:
File3.write(x +"" + y + "In")
except IOError:
print("File Write Error : [Errno 13] Permission Denied : 'invalid, txt'")
39
40
In (2):
41
42
elif y not in the_vaild_letter:
try:
File3.write(x + " "
43
44
Python console History
+ y + "\n")
UTF-8
CRLF
RW
Mem 3
45
* Kite: ready
O conda: bese (Python 3.7.6)
Line 28, Col 15
7:14 PM](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Ffda25008-6811-4f3a-896c-3b0e49712a6d%2F03e47961-f3fd-40d3-b939-562da6abec3c%2Fp6q6wll_processed.jpeg&w=3840&q=75)
Transcribed Image Text:,"MB', 'MM", "A", 'MY',
(Python 3.7)
Search Source Run Debug Consoles Projects Tools View Help
四 @
CAUserslosamalOnebrvelDesktop1Osama squiosama\python\assginmnete
osamalOneDrive\Desktop\Osama squ\osama\python\assginmnetHW4.py
4 B , a o
4.py
Name
Туре
Size
Value
File1
TextIOWrapper 1
TextIOWrapper object of _1o nodule
Qauthor: osama
['12 A
, '123 B8
inputs
1ist
inputs""
try:
Filel- open("plates. txt", "r")
inputs-Filei.readlines()
except IOError:
line
Int
1
the veild letter list
['A', "AA', 'AB', 'AD', AR',
, "AM', 'AY', 8, BA, ...)
47
print("File Read Error : [Errno 2] No such file or directory : 'plates.txt")
File2- open ("valid. txt", "a")
6
File3e open("invalid. txt", "a")
18 - the_vaild letter- ['A', 'AA', 'AB', 'AD', "AR', "AM', "AW', 'AY',
19
20
'B', 'BA', "BB', 'BD', 'BR', 'BM", 'BW', "BY',
'D', 'DA', 'DD', 'DR', 'DW", "DY",
'R', 'RA', 'RR', 'RM', 'RW', 'RY
'S','SS
'M', 'MA', 'MB", 'MM', 'MW', 'MY',
"W', 'WA', "WB', 'MW',
'Y', 'YA', "YB', 'YD', 'YR', 'YW', 'YY']
21
Variable explorer Help Plots Files
22
23
O Console 7/A X
Python 3.7.6 (default, Jan 8 2020, 20:23:39) [MSC v.1916 64 bit (AMD64)]
Type "copyright", "credits" or "license" for more information.
24
25
26
line-1
28 - for i in input
try:
27
IPython 7.12.0 -- An enhanced Interactive Python.
In [1): runfile('C:/Users/osama/OneDrive/Desktop/Osama squ/osama/python/assginmnet4/H44.py",
wdir-'C:/Users/osama/OneDrive/Desktop/Osama squ/osama/python/assginmnet4')
Traceback (most recent call last):
29
30
x,y - i. split
31
32
if x[0]=="0":
File "C:\Users\osama\OneDrive\Desktop\Osama squ\osama\python\assginmnet4\HW44.py", line 28,
in <module>
for i in input:
33
34
try:
File3.write(x +"+ y + *"\n")
-
except IOError:
print("File Write Error : [Errno 13] Perwission Denied : 'invalid. txt'")
35
36
TypeError: 'method' object is not iterable
37
38
elif int (x) > 99999:
try:
File3.write(x +"" + y + "In")
except IOError:
print("File Write Error : [Errno 13] Permission Denied : 'invalid, txt'")
39
40
In (2):
41
42
elif y not in the_vaild_letter:
try:
File3.write(x + " "
43
44
Python console History
+ y + "\n")
UTF-8
CRLF
RW
Mem 3
45
* Kite: ready
O conda: bese (Python 3.7.6)
Line 28, Col 15
7:14 PM
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education