Skip to content
This repository was archived by the owner on Apr 3, 2022. It is now read-only.
This repository was archived by the owner on Apr 3, 2022. It is now read-only.

Code Review #11

@task-master98

Description

@task-master98

I am trying to understand the simulator code for a project. I am unable to figure out the logic for the get_random_slice_index() method in main.py. It contains the following piece of code:

def get_random_slice_index(vals):
    i = 0
    r = random.random()

    while vals[i] < r:
        i += 1
    return i  

I am unable to figure out the logic for the while loop condition. Kindly assist me in the same.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions