Skip to content

Instantly share code, notes, and snippets.

@kusal1990
Created June 24, 2022 07:40
Show Gist options
  • Save kusal1990/9bb2fad13d0f44bbf531a67948a1e385 to your computer and use it in GitHub Desktop.
Save kusal1990/9bb2fad13d0f44bbf531a67948a1e385 to your computer and use it in GitHub Desktop.
def extract_answers(question):
'''
This function will take a value in question column then, will split the string
at (A) or (1). After splitting we will take only first part which is the question.
'''
if '(A)' in question:
x = '(A) ' + question.split('(A)')[1]
elif '(1)' in question:
x = '(1) ' + question.split('(1)')[1]
return x
@kusal1990
Copy link
Author

ok

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