Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Interview task
#2
Sorry about the interview. You'll do better next time.

Supposing that they're referring to PEP 8 standards, here are the issues I see:

  1. Variable names should be lowercase with underscores to improve readability:
    class_object = cm.assignmentTask()
    file_name = sys.argv[1]
    sub_seq_length = int(sys.argv[2])
    class_method = sys.argv[3]
  2. Also with the above, do not use more than one space between an operator and the operands to align operators on multiple lines.
  3. Conditionals do not need parentheses.
    if class_method == "values":
        class_object.values(lst1, sub_seq_length)
    elif class_method == "differences":
        class_object.differences(lst1, sub_seq_length)    
  4. Class names should use CapWords format:
    class AssignmentTask():
  5. Lines should not exceed 79 characters. Many of the inline comments extend beyond that limit.
  6. Comments should be complete sentences with subject and verb and a capitalized first letter and ending punctuation.
  7. Inline comments should be used sparingly.

On a side note, I'm not understanding the purpose of assigning attributes in assignmentTask. Neither attribute gets used because all invocations are of the arguments passed in instead.

Also, more descriptive names than "lst1" and "l1" may have benefited you.
Reply


Messages In This Thread
Interview task - by khazi - Feb-03-2019, 04:02 PM
RE: Interview task - by stullis - Feb-03-2019, 06:11 PM
RE: Interview task - by buran - Feb-03-2019, 07:14 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  count certain task in task manager[solved] kucingkembar 2 1,135 Aug-29-2022, 05:57 PM
Last Post: kucingkembar
  Schedule a task and render/ use the result of the task in any given time klllmmm 2 2,110 May-04-2021, 10:17 AM
Last Post: klllmmm
  How to create a task/import a task(task scheduler) using python Tyrel 7 3,762 Feb-11-2021, 11:45 AM
Last Post: Tyrel

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020