Город МОСКОВСКИЙ
00:05:49

Write a Program That Prompts For a File Name, Then Opens That File And Reads Through The File, And

Аватар
JavaScript: создание веб-сервисов
Просмотры:
22
Дата загрузки:
29.11.2023 09:47
Длительность:
00:05:49
Категория:
Обучение

Описание

write a program that prompts for a file name, then opens that file and reads through the file, and print the contents of the file in upper case. use the file words.txt to produce the output below.

Hello Programmers, Welcome to my channel.

In this video you will learn about how to Write a Program That Prompts For a File Name, Then Opens That File And Reads Through The File, And Print The Contents of The File in Upper Case. Use The File words.txt to Produce The Output


Code
=============================
filename = input("Enter a filename : ")
fd_read = None

try:
fd_read = open(filename, "r")
except FileNotFoundError:
print("The file you entered does not exists")
exit(1)

for line in fd_read.readlines():
print(line.upper(), end="")

fd_read.close()


Keywords
=============================
#python #python3 #python_assignment #pythonprogramming #pythontutorial #pythonprojects #pythoncourse #pythonbaba #pythonforbeginners #pythonautomation #pythonbasic #pythonbeginners

Рекомендуемые видео