# # input
# x=input("Enter a number")
# # output
# print(x)

# to read file use 'open' command do not forget to close file at the end
# text_from_file = open("Z:\sample.txt")
# for line in text_from_file:
#     # print(line)
# #    print(1,2,3,4, sep=':') # this is a separator of output
#     print(line, end='') # to exclude wite line between the lines because file contains '\n' symbol of new line by default
#
# text_from_file.close()
# to open and read file you can use 'with' command in this case you don't need to close file at the end

#with open('Z:\sample.txt','r') as text_file: # 'r' means that file open for reading
# with open('Z:\sample.txt') as text_file:
#     for text in text_file:
#         print(text,end='')

# # to work with line we can use 'readline'
# with open('Z:\sample.txt') as text_file:
#     line_of_text=text_file.readline()
#     print(line_of_text)
# assign the whole text to variable you can use 'read'
with open('Z:\sample.txt') as text_file:
    whole_text=text_file.read()
    print(whole_text)