Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9226513
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T04:50:59+00:00 2026-06-18T04:50:59+00:00

I’m writing a program that allows a user to set up personal quizzes (like

  • 0

I’m writing a program that allows a user to set up personal quizzes (like a notecard-type system). When taking the quiz, the user is timed on each question. The answers aren’t going to be multiple choice though, they will be user-inputted.

Is there a way that I can sufficiently accept answers that aren’t complete answers of the input they put in when they first set up their quiz?

Example

Q: “Who is Socrates.”

A: “A Greek Philosopher.”


I thought about using something like:

if input in answer:
    print "That's correct."

But that doesn’t work at all.

Is there any possible way to do this? Or something close to it.

—update—

I just recently came across a Python Module that is outstanding at doing this, it’s called FuzzyWuzzy and here is a link to it’s description and what all it can do http://seatgeek.com/blog/dev/fuzzywuzzy-fuzzy-string-matching-in-python

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T04:51:01+00:00Added an answer on June 18, 2026 at 4:51 am

    It depends on exactly what you’re trying to do. Your attempt sounds like you are trying to match any substring of “A Greek Philosopher”, so “ee” would be a correct answer. That doesn’t sound right.

    You could have a set (or list) of possible correct answers for each question. For your example maybe you would also accept just “Philosopher”.

    If you would like to ignore spelling mistakes, you could test if what was entered is “close” to any of the know correct answers. This requires a function that will calculate how close the match is. A popular approach is to use Levenshtein Distance. See:

    http://en.wikipedia.org/wiki/Levenshtein_distance
    http://en.wikibooks.org/wiki/Algorithm_implementation/Strings/Levenshtein_distance
    http://code.activestate.com/recipes/576874-levenshtein-distance/
    http://pypi.python.org/pypi/python-Levenshtein/

    Update

    Levenshtein Distance is good if you want to allow inexact spelling. But if you want to allow different phrases, i.e. “A Philosopher from Ancient Greece” then a different approach is required. If you’re really motivated, you could try to use NLTK, Natural Language Toolkit for Python to implement a type of fuzzy phrase matching where you try to match parts of speech rather then the exact phrase provided. Be aware, this is not trivial.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a string that has curly quotes in it. I'd like to replace
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a small JavaScript validation script that validates inputs based on Regex. I
I have a French site that I want to parse, but am running into
I am doing a simple coin flipping experiment for class that involves flipping a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.