Python
Write function words() that takes one input argument—a
file name—and returns the list of actual...
Python
Write function words() that takes one input argument—a
file name—and returns the list of actual words (without punctuation
symbols !,.:;?) in the file.
>>>
words('example.txt')
['The', '3', 'lines', 'in',
'this', 'file', 'end', 'with', 'the', 'new', 'line', 'character',
'There', 'is', 'a', 'blank', 'line', 'above', 'this',
'line']
Q1) Write a Python function partial_print,
which takes one parameter, a string, and prints the first,...
Q1) Write a Python function partial_print,
which takes one parameter, a string, and prints the first, third,
fifth (and so on) characters of the strings, with each character
both preceded and followed by the ^ symbol, and
with a newline appearing after the last ^ symbol.
The function returns no value; its goal is to print its output, but
not to return it.
Q2)
Write a Python function called lines_of_code
that takes a Path object as a parameter, which is...
asap python:
Write a function called fileCaseSwap that takes 2 filenames
(strings) as input parameters. The...
asap python:
Write a function called fileCaseSwap that takes 2 filenames
(strings) as input parameters. The function should:
Open the first file for reading
Open the second file for writitng
Read the first file
Swap the case (swapcase) of every character in
the file
Write the replaced text to the second file.
test call:
fileCaseSwap("emma-short.txt", "emma-short-swap.txt")
fileCaseSwap("emma.txt", "emma-swap.txt")
"""
"""
The first 3 lines of the emma-short-swap.txt file should be
emma
bY jANE aUSTEN
Write an assembly program that reads characters from standard
input until the “end of file” is...
Write an assembly program that reads characters from standard
input until the “end of file” is reached. The input provided to the
program contains A, C, T, and G characters. The file also may have
new line characters (ASCII code 10 decimal), which should be
skipped/ignored. The program then must print the count for each
character. You can assume (in this whole assignment) that the input
doe not contain any other kinds of characters. the X86
assembly program that simply counts...
Project File Processing.
Write a program that will read in from input file one line at...
Project File Processing.
Write a program that will read in from input file one line at a
time until end of file and output the number of words in the line
and the number of occurrences of each letter. Define a word to be
any string of letters that is delimited at each end by either
whitespace, a period, a comma or the beginning or end of the line.
You can assume that the input consists entirely of letters,
whitespaces,...
Writing a program in Python that reads a text file and organizes
the words in the...
Writing a program in Python that reads a text file and organizes
the words in the file into a list without repeating words and in
all lowercase.
Here is what I have
#This program takes a user input file name and returns each word
in a list
#and how many different words are in the program.
while True: #While loop to loop program
words = 0
#list1 =
['Programmers','add','an','operating','system','and','set','of','applications','to','the','hardware',
#
'we','end','up','with','a','Personal','Digital','Assistant','that','is','quite','helpful','capable',
#'helping','us','do','many','different','things']
try:
...