import pandas as pd
def find_s_algorithm(file_path):
 data = pd.read_csv(file_path)
 print("Training data:")
 print(data)
 attributes = data.columns[:-1]
 class_label = data.columns[-1]
 hypothesis = ['?' for _ in attributes]
 for index, row in data.iterrows():
     if row[class_label] == 'Yes':
         for i, attr in enumerate(attributes):
             if hypothesis[i] == '?' or hypothesis[i] == row[attr]:
                 hypothesis[i] = row[attr]
 else:
     hypothesis[i] = '?'
     return hypothesis
file_path = "C:\\Users\\STUDENT\\Downloads\\training_data.csv"
hypothesis = find_s_algorithm(file_path)
print("\nThe final hypothesis is:", hypothesis) 