Find Jobs
Hire Freelancers

Python Questions - Need Solutions in Python

₹600-1500 INR

Completed
Posted over 1 year ago

₹600-1500 INR

Paid on delivery
Q1. We are building a word processor and we would like to implement a "word-wrap" functionality. Given a list of words followed by a maximum number of characters in a line, return a collection of strings where each string element represents a line that contains as many words as possible, with the words in each line being concatenated with a single '-' (representing a space, but easier to see for testing). The length of each string must not exceed the maximum character length per line. Your function should take in the maximum characters per line and return a data structure representing all lines in the indicated max length. Examples: words1 = [ "The", "day", "began", "as", "still", "as", "the", "night", "abruptly", "lighted", "with", "brilliant", "flame" ] wrapLines(words1, 13) "wrap words1 to line length 13" => [ "The-day-began", "as-still-as", "the-night", "abruptly", "lighted-with", "brilliant", "flame" ] wrapLines(words1, 20) "wrap words1 to line length 20" => [ "The-day-began-as", "still-as-the-night", "abruptly-lighted", "with-brilliant-flame" ] words2 = [ "Hello" ] wrapLines(words2, 5) "wrap words2 to line length 5" => [ "Hello" ] words3 = [ "Hello", "world" ] wrapLines(words3, 5) "wrap words3 to line length 5" => [ "Hello", "world" ] words4 = ["Well", "Hello", "world" ] wrapLines(words4, 5) "wrap words4 to line length 5" => [ "Well", "Hello", "world" ] words5 = ["Hello", "HelloWorld", "Hello", "Hello"] wrapLines(words5, 20) "wrap words 5 to line length 20 => [ "Hello-HelloWorld", "Hello-Hello" ] All Test Cases: words, max line length wrapLines(words1, 13) wrapLines(words1, 20) wrapLines(words2, 5) wrapLines(words3, 5) wrapLines(words4, 5) wrapLines(words5, 20) n = number of words OR total characters Q2. We are building a word processor and we would like to implement a "reflow" functionality that also applies full justification to the text. Given an array containing lines of text and a new maximum width, re-flow the text to fit the new width. Each line should have the exact specified width. If any line is too short, insert '-' (as stand-ins for spaces) between words as equally as possible until it fits. Note: we are using '-' instead of spaces between words to make testing and visual verification of the results easier. lines = [ "The day began as still as the", "night abruptly lighted with", "brilliant flame" ] reflowAndJustify(lines, 24) "reflow lines and justify to length 24" => [ "The--day--began-as-still", "as--the--night--abruptly", "lighted--with--brilliant", "flame" ] // <--- a single word on a line is not padded with spaces reflowAndJustify(lines, 25) "reflow lines and justify to length 25" => [ "The-day-began-as-still-as" "the-----night----abruptly" "lighted---with--brilliant" "flame" ] reflowAndJustify(lines, 26) "reflow lines and justify to length 26" => [ "The--day-began-as-still-as", "the-night-abruptly-lighted", "with----brilliant----flame" ] reflowAndJustify(lines, 40) "reflow lines and justify to length 40" => [ "The--day--began--as--still--as-the-night", "abruptly--lighted--with--brilliant-flame" ] reflowAndJustify(lines, 14) "reflow lines and justify to length 14" => ['The--day-began', 'as---still--as', 'the------night', 'abruptly', 'lighted---with', 'brilliant', 'flame'] All Test Cases: lines, reflow width reflowAndJustify(lines, 24) reflowAndJustify(lines, 25) reflowAndJustify(lines, 26) reflowAndJustify(lines, 40) reflowAndJustify(lines, 14) n = number of words OR total characters
Project ID: 34321224

About the project

7 proposals
Remote project
Active 2 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
Hi there! I am Professional in Scraping Data , Data Entry Operator and Python expert in since 2 years.I have gone through your outsourced requirement and have analyzed that I have right credentials To do this job properly with better performence I am sure 100% that I can do your project as you required . I want to point that I have enough experience to do this task to the fullest in order to prove my skills and abilities in this field and of course, to help you complete this work as required, I am ready to start right now. contact me for better communication. Thank you
₹1,200 INR in 7 days
5.0 (3 reviews)
2.7
2.7
User Avatar
Hi, I hope you are doing great. I saw your two questions. I can help with implement both of these as I have multiple years of experience with python programming and I can start immediately if you want to and can deliver in 1-2 hours max. Regards
₹1,000 INR in 1 day
5.0 (5 reviews)
3.8
3.8
7 freelancers are bidding on average ₹2,021 INR for this job
User Avatar
I am Ring. I am about 19+ years experienced in GNU/Linux based system, server installation and customization, develop, deploy, security and support. I may help you in this regard.
₹3,500 INR in 1 day
4.9 (11 reviews)
3.9
3.9
User Avatar
Hello I have read the questions and i can provide the solutions for you with details comments explaining each part of the code
₹5,000 INR in 7 days
4.9 (19 reviews)
3.8
3.8
User Avatar
I'll do your task within a few hours without any mistakes and problems. The bid amount and some questions may be discussed in a private chat.
₹900 INR in 1 day
0.0 (0 reviews)
0.0
0.0
User Avatar
Hi there! I just checked the two questions and I'll be glad to provide you with a detailed solution. I am a software engineer with 5+ years of experience in python and solving problems in this language became pretty intuitive to me thanks to the massive problem solving I've been doing for fun. Please award me the project so that we can discuss it more.
₹1,050 INR in 7 days
0.0 (0 reviews)
0.0
0.0

About the client

Flag of INDIA
DEWAS, India
5.0
1
Payment method verified
Member since May 29, 2016

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.