Apr-15-2019, 08:59 PM
The
else
is not indented to be inline with the if
group_list = client.list_groups() all_groups = [] for group in group_list['Groups']: group_name = group['GroupName'] all_groups.append(group_name) for group_name in all_groups: print(group_name) add_group_name = '' while add_group_name != 'quit': add_group_name = input("Enter the group name to add to user %s: " % user_name) if add_group_name == 'quit': break else: print("Add user to group.") client.add_user_to_group(GroupName=add_group_name,UserName=user_name)