Hi@akhtar,
You need to create a client using the boto3 module. It allows you to use some attributes related to s3 as shown below.
s3 = boto3.client('s3')
response = s3.list_buckets()
# Output the bucket names
print('Existing buckets:')
for bucket in response['Buckets']:
print(f' {bucket["Name"]}')