PART A:
Write code for a python function called load_data that accepts a string
that holds the name of a file on disk, a dictionaryi, and a key (string).
This function will read all characters of the file into a 2-Dimensional list (array).
All characters of the same row will form a list and each row will be an element of the 2D list
For example, if the file contains
abcd
efgh
then list_2d = [['a','b','c','d'], ['e','f','g','h']]
The function then stores this list in the dictionary
using the supplied string as key. The file must be closed after a successful read.
This function returns the entire dictionary (8 marks).
PART B:
Write the code for a python function called replace_data that accepts a
loaded dictionary from PART A, a key (string), a search character (single character),
and a replacement character (single character).
This function will replace all occurrences of search character with
replacement character for the lines in the dictionary using the supplied key and
return the total number of times the search character was replaced.
You may assume that the search and replace characters will always be valid
2D list in the dictionary (12 marks).
'''
sample file 10x10 named "[login to view URL]"
^^^^X^^^^^
^2^^^^^^8^
^PHP^^^^^^
^PYTHON^^^
^^^^^C++^^
^^JSCRIPT^
PHP^^WEB^^
GO-LANG^^^
^^^RUBY^^^
^^^^^RUST^
'''
import math
import random
import string
import collections
import datetime
import re
import time
import copy
# program: [login to view URL]
# student: your name
# student number: 123456789
# date: June 21, 2022
# purpose: solution to PRG550X Lab Test #1
# Your functions MUST be placed here...
# Your functions MUST be placed here...
def main( ) :
table1 = { }
table2 = load_data('[login to view URL]', table1, "mask")
print("Loaded Data:")
for j in range(10) :
for k in range(10) :
print(table2['mask'][j][k], end="")
print( )
print( )
num_replacements = replace_data(table2, "mask", '^','*')
table_out = table2["mask"]
print("Updated Data:")
for j in range(10) :
for k in range(10) :
print(table_out[j][k], end="")
print()
print(f"{num_replacements}")
if __name__ == "__main__" :
main( )
# If your solution to PARTS A and B have been completed correctly, the main( )
# function above will display the output EXACTLY as listed below.
Loaded Data:
^^^^X^^^^^
^2^^^^^^8^
^PHP^^^^^^
^PYTHON^^^
^^^^^C++^^
^^JSCRIPT^
PHP^^WEB^^
GO-LANG^^^
^^^RUBY^^^
^^^^^RUST^
Updated Data:
****X*****
*2******8*
*PHP******
*PYTHON***
*****C++**
**JSCRIPT*
PHP**WEB**
GO-LANG***
***RUBY***
*****RUST*
57
Hi there,
I checked your requirements and guarantee you it's gonna be done within the next few hours.
Let's contact via chat so that I can start work immediately.
Wish you the best.
Hello,
Hope this message finds you well, I checked your details and I believe that my experience is what you are looking 4. I have been working on similar projects for the past 8 years, and I have the essential skills including;
Python
Software Architecture
I will prove to be of great help to you. SEND MESSAGE/CHAT, so that we can discuss more on the details including budget and deadlines…
I have not been online on freelancer for sometime, Covid came with all its inconveniences but am happy to be back doing what I love most
Regards,
BrainCenter Inc
Hello,
I hope you are doing well, how are you?
if you are looking for someone who can do the job in a fast and reliable way you are in the right place!
I am an expert in python problem solving, I got great experience with modules of python like math, re and much more.
Do you have a budget in mind for this project?
I can do the project for you and make the program as you required.
I solved many programming problems before
Allow me to show you my talent!
Best regards,
Rawan
Hi, Dear Employer, I am "Al. A". I am a professional "Copywriter ". I'm an expert in Copywriting with over 7+ years of experience. I have worked on several similar projects on freelancer.com and can deliver professional content to tight deadlines.
I CAN'T USE ANY WRITING TOOLS, GOOGLE, AND COPY OR PASTE. I GIVE YOU 100% HUMAN MANUAL WRITING.
Please feel free to send me a message for a chat to discuss your requirements." Gratefulness “Al.A.
Python code
Interesting and short animated video
Software Architecture and Python
Hi,
• This is Sairus Khalil from DW Solution online.
• I'm certified in short animated video by freelancer.com.
• You can also check certificate in my profile.
• DW Solution Online is providing Video Editing Services. Get Professional Whiteboard / 2D & Explainer Animated Videos.
Basic Pack (Full Package)
- Animated Video (Colorful / Whiteboard) based on 75 words (30 Secs Approx)
- Voice Over
- Voice Over Sync
- Characters
- Scenes
- Script Writing
- HD 1080p Rendering
- Background music
- Adding Your Logo / Web URL
Standard Pack (Full Package)
- Animated Video (Colorful / Whiteboard) based on 150 words (60 Secs Approx)
- Voice Over
- Voice Over Sync
- Characters
- Scenes
- Script Writing
- HD 1080p Rendering
- Background music
- Adding Your Logo / Web url
• Kindly provide detailed information on what you need done
• you .
• Feel Free to contact.
- - - - READY TO START WORKING NOW - - - -
Hi there!
I can write both python function for you.
Still, I'm working(part-time) as a full-stack developer for E-Vision software ltd, one of the oldest and reputed IT farms in our city.
=== So, it’s a pretty simple task for me===
I've 4years+ of experience in the field of web development with HTML, CSS, Bootstrap, PHP, Python, MySQL, JavaScript, JQuery, Codeigniter, Laravel, etc.
Eagerly waiting for your response and ready to start working instantly.
=== UNLIMITED REVISIONS UNTIL YOU ARE 100% SATISFIED ===
Regards
(: Good day :)
I have read your description and understood your proposal.
I have rich experience in python for DL & ML, Image Processing for 6 years.
As you can see my profile, I have many projects before that you are familiar.
I have completed many projects using tensorflow, pytorch, theano, caffe and so on.
I will use transfer learning by pre-trained model to complete your project.
I can help you sufficiently and you will get good result.
Please discuss more details via private chat.
Thanks.
MASTERS IN SOFTWARE DEVELOPMENT AND ARCHITECTURE.
EXPERT IN JAVASCRIPT, HTML5, CSS C, C++, PYTHON, JAVA, PHP, FLUTTER, NODE.JS, REACT.JS, REACT NATIVE.
Hi there! Thank you for sharing your project requirement, I have carefully read the project description and I would like to take part in this project.
Inbox to discuss this. Thank you.
Hello,
I'm a senior at Boston University, and I've been using Python for about 3 years now. I've completed a very similar project to this during my freshman year that involved reading words from a .txt file, and storing the subsequent words in a dictionary to create a predictive text application. I should be able to complete this project very quickly. If you choose to accept this bid, I can either send you the file directly or invite you to a private GitHub repository so you can pull the code from it.
Thanks! Joseph