1st Guided Project: parameters in the explore_data() function

def explore_data(dataset, start, end, rows_and_columns=False):
dataset_slice = dataset[start:end]
for row in dataset_slice:
print(’\n’) # adds a new (empty) line after each row

if rows_and_columns:
    print('Number of rows:', len(dataset))
    print('Number of columns:', len(dataset[0]))

I don’t quite understand the parameter - rows_and_columns = False. How does Python recognize this variable? Why should we set it as False as default?

Hi @ling.xu81, welcome to the community!

I think this post will help you:

1 Like

Hi @april.g. This explained it very well. Thanks for the help!

1 Like