129,903 views
11 votes
11 votes
Complete the code.

import csv
inFile = open ("one.txt","r")
outFile = open("another.txt", "w")
myReader = csv.reader(inFile)
for item in myReader:
aWord = item[0]
aNumber = "___" (item[1]) + 0.4
line = aWord + "," + str(aNumber) + '\\'
outFile.write(line)

float,str,int

User XQuare
by
2.3k points

2 Answers

16 votes
16 votes

Answer: str

Explanation: string

User Kelvincer
by
3.2k points
17 votes
17 votes

Answer:

import csv

inFile = open ("one.txt","r")

outFile = open("another.txt", "w")

myReader = csv.reader(inFile)

for item in myReader:

aWord = item[0]

aNumber = float(item[1]) + 0.4

line = aWord + "," + str(aNumber) + '\\'

outFile.write(line)

User Trupanka
by
3.5k points