Skip to content

Ruy Zambrano Random-Name-Generator Submission#25

Open
Ruyzambrano wants to merge 17 commits intoalexnaylor99:mainfrom
Ruyzambrano:main
Open

Ruy Zambrano Random-Name-Generator Submission#25
Ruyzambrano wants to merge 17 commits intoalexnaylor99:mainfrom
Ruyzambrano:main

Conversation

@Ruyzambrano
Copy link

No description provided.

Copy link

@HineshX HineshX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great work!

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clarification, not sure what this


# Check if the user has input names.
if names == '':
print('You must enter at lease 1 name. Try again.')
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

at least* typo


# Return entire list of names if there aren't enough.
else:
shortlist = list_names
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if number they choose exceeds number of names given, a 'random' number of names are not given, maybe implement code that generates all the names but still randomized?


# Generate the shortlist.
if len(list_names) > num_names:
shortlist = random_name_generator(list_names, num_names)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of creating a function and then calling it here, would it not be more concise to just implement the random.sample() code here? e.g shortlist = random.sample(list_names, num_names)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants