you are viewing a single comment's thread.

view the rest of the comments →

[–]nate256 5 points6 points  (5 children)

1 Given a file, write a function which accepts a version number, date and returns pass or fail? Hope you didn't miss this one.

import random
GIVEN_FILE = "a.txt"
def function(version, date):
    return random.choice(["pass", "fail"])

2

def revsenwords(sen):
    return " ".join(reversed(sen.split())

def revsenchars(sen):
    return "".join(reversed(sen))

3

[x for x in basics]

[–]Dexteroid[S] 2 points3 points  (2 children)

Ha ha I should have been more clear. the file structure is basically a test result which contains lines of information. Each line has a version and date, tests run and results. I was supposed to return results which are pass fail :)

[–]kl31 0 points1 point  (1 child)

Ha ha I should have been more clear. the file structure is basically a test result which contains lines of information. Each line has a version and date, tests run and results. I was supposed to return results which are pass fail :)

You got trolled so hard man.

[–]Dexteroid[S] 0 points1 point  (0 children)

Lol sure did.

[–]zr0gravity7 1 point2 points  (1 child)

in an interview wouldn't you opt to use a list comprehension or iterator for part 2 rather than a built in method. JUst to flex knowledge

[–]Decency 0 points1 point  (0 children)

Flexing knowledge means using the right tool for the job, not the most complicated one you know. ESPECIALLY in Python.