Answer to Question #3393 in Python for mukunda

Question #3393
Write a program to open a text file which contains two strings, i.e. your first name and last name, read those names and concatenate them and print in a text called fullname.txt. (Note concatenating strings example string1 + string2 if they are of two strings)
1
Expert's answer
2011-08-04T12:32:01-0400
fin = open ("twostrings.txt")
firstname, lastname = fin.readline()[:-1], fin.readline()

fout = open ("fullname.txt", "w")
fout.write(firstname + " " + lastname)
fout.close()

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS