import csvx r".\Pioneers.txt"p r".\FourMore Pione ers.txt"f-open (x)names-morePioneersFile=open (p)for lines in csv.reader (f)names.append (lines [0])f.closef-open (x,"a")for newLine in csv.reader (morePioneersFile)if newLine [0] notin names:names.append (newLine [0])else:continuenewLine=",".join (newLine)f.write (f'\n{newLine } ')f.closemorePioneersFile.close ()

Question
Asked Dec 2, 2019
1 views

Python 3.7.4:

I just need help with the indentation. I don't need you to look at the code itself so don't worry about that being right or wrong, I just need to double-check that I intented everything properly.  Thank you for your help!

import csv
x=r".\Pioneers.txt”
p=r".\FourMorePioneers.txt"
f=open(x)
names=[]
morePioneersFile=open(p)
for lines in csv.reader(f):
names.append(lines[0])
f.close()
f=open(x,"a")
for newLine in csv.reader(morePioneersFile):
if newLine[0]not in names:
names.append(newLine[0])
else:
continue
newLine=",".join(newLine)
f.write(f'\n{newLine}')
f.close()
morePioneersFile.close()

import csv
x r".\Pioneers.txt"
p r".\FourMore Pione ers.txt"
f-open (x)
names-
morePioneersFile=open (p)
for lines in csv.reader (f)
names.append (lines [0])
f.close
f-open (x,"a")
for newLine in csv.reader (morePioneersFile)
if newLine [0] not
in names:
names.append (newLine [0])
else:
continue
newLine=",".join (newLine)
f.write (f'\n{newLine } ')
f.close
morePioneersFile.close ()
help_outline

Image Transcriptionclose

import csv x r".\Pioneers.txt" p r".\FourMore Pione ers.txt" f-open (x) names- morePioneersFile=open (p) for lines in csv.reader (f) names.append (lines [0]) f.close f-open (x,"a") for newLine in csv.reader (morePioneersFile) if newLine [0] not in names: names.append (newLine [0]) else: continue newLine=",".join (newLine) f.write (f'\n{newLine } ') f.close morePioneersFile.close ()

fullscreen
check_circle

Expert Answer

Answer:

Yes”, the indentation is correct. One small mistake is in line 2, the...

Want to see the full answer?

See Solution

Check out a sample Q&A here.

Want to see this answer and more?

Solutions are written by subject experts who are available 24/7. Questions are typically answered within 1 hour.*

See Solution
*Response times may vary by subject and question.
Tagged in

Engineering

Computer Science

Python

Related Computer Science Q&A

Find answers to questions asked by student like you

Show more Q&A add
question_answer

Q: - Find the total amount of money needed in order to give 5% salary increase to all mangers and 4% in...

A: To execute the given query first create a database with the required fields.Create table syntax is:C...

question_answer

Q: Express the following function in sum of minterms and product of maxterms:   a) F(A,B,C,D) = B’D + A...

A: (a) F (A, B, C, D) = B’D + A’D + BDSum of minterms:= B’D + A’D + BD= B’D (A + A’) (C + C’) + A’D (B ...

question_answer

Q: IN PYTHON Linked Lists Consider the implementation of the Linked list class, implement the following...

A: A Python program for the given scenarios is as follows,import random# Node class class Node:    # Co...

question_answer

Q: Write a program with python using random module for a (very) rudimentary shooter "game". You are the...

A: Program Algorithm-START-Step1: Import the essential modulesStep2: Define the shoot function.Step3: U...

question_answer

Q: JAVA threads confused help 1. A)Consider the Java program. What is the expected logical output? What...

A: Multithreading in java: It is an essential feature of java that performs two or more programs to run...

question_answer

Q: In C++, what is the difference between the functions cin.clear() and cin.ignore(), and when are they...

A: In C++,If an error occurs while reading input using cin then,clear() is used to clear all the error ...

question_answer

Q: Which is the following is true? 1.The 80/20 rule states that 80% of the instruction is executed and ...

A: Answer:80/20 rule was first introduced by Vilfredo Pareto and therefore in also commonly known as Pa...

question_answer

Q: Copy and paste the following definition of the class Car in the submission box and then add a method...

A: Program implementation-def is used to declare a method. Here, def is used to declare brake method in...

question_answer

Q: For the following problems assume 1 kilobyte (KB) 1024 kilobytes 1024 bytes and 1 megabyte (MB) For ...

A: Hey, since there are multiple questions posted, we will answer first question. If you want any speci...