import random


def successful_starts(success_prob, num_trials):
    """Assumes success_prob is a float representing probability of a
         single attempt being successful. num_trials a positive int
       Returns a list of the number of attempts needed before a
         success for each trial."""
    tries_before_success = []
    for t in range(num_trials):
        consec_failures = 0
        while random.random() > success_prob:
            consec_failures += 1
        tries_before_success.append(consec_failures)
    return tries_before_success