Answer:
file_name = 'orders.txt'
file_obj = open( file_name, 'r' )
lines = file_obj.read()
print(lines.upper(), end = '')
Explanation:
- Define the name of the file
.
- Use the built-in open function to open the file in read mode
.
- Use the built-in read function to read the file and assign this to lines variable.
- Finally display the lines by converting them to capital alphabets by using the built-in upper() function.
Answer:
Check the explanation
Explanation:
def get_list_of_integers_from_file(filename):
int_list=[]
for line in open(filename).readlines():
try:
int_list.append(int(line))
except:
continue
return int_list
print(get_list_of_integers_from_file('file.txt'))
File.txt:
Kindly check the output below.
Answer:pointsssExplanation:
E) both C and D
Erro handling and execution paths
Photography allows us to view the world around us in different ways, by giving us the sense and feel of what others feel, Photography is art. You are able to use photography to define actions, for example happiness in a marriage or happiness in children playing at the park. Photography also allows you to explore and discover new things, and make something out of that. It makes you think a bout different ways to change the world around you, how do you define the world?