Answers for "how to print on different lines python"

2

how to compare two text files in python

with open('some_file_1.txt', 'r') as file1:
    with open('some_file_2.txt', 'r') as file2:
        same = set(file1).intersection(file2)

same.discard('n')

with open('some_output_file.txt', 'w') as file_out:
    for line in same:
        file_out.write(line)
Posted by: Guest on May-11-2020
0

how to print a word in different line in python

print("first line", "second line", sep="n")
print("first linenSecond line")
Posted by: Guest on May-04-2020
0

how to make python print 2 line text in one code

print("firstnsecond")
#or
print("""
line1
line2
line3
""")
#or
print("line1","line2",sep = "n")
Posted by: Guest on July-31-2021

Code answers related to "how to print on different lines python"

Python Answers by Framework

Browse Popular Code Answers by Language