diff options
author | Martin <martin@leo.fri1.uni-lj.si> | 2015-10-08 11:17:16 +0200 |
---|---|---|
committer | Martin <martin@leo.fri1.uni-lj.si> | 2015-10-08 11:17:16 +0200 |
commit | 1f9f6de923e4b490c42a44d660b3e32dbe11426e (patch) | |
tree | f103aa69d256f5985bdf4815b64e33af0664d88a /python/problems/introduction/fahrenheit_to_celsius/common.py | |
parent | bab0b0a2fe8b3aad853740750d4873fb929f5f41 (diff) |
Added final hint to contains_42.
Diffstat (limited to 'python/problems/introduction/fahrenheit_to_celsius/common.py')
-rw-r--r-- | python/problems/introduction/fahrenheit_to_celsius/common.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/python/problems/introduction/fahrenheit_to_celsius/common.py b/python/problems/introduction/fahrenheit_to_celsius/common.py index 6549c32..918c643 100644 --- a/python/problems/introduction/fahrenheit_to_celsius/common.py +++ b/python/problems/introduction/fahrenheit_to_celsius/common.py @@ -3,6 +3,7 @@ from python.util import has_token_sequence, string_almost_equal, \ string_contains_number, get_tokens, get_numbers, get_exception_desc from server.hints import Hint +import re id = 180 group = 'introduction' @@ -87,6 +88,9 @@ def hint(python, code): if not has_token_sequence(tokens, ['input']): return [{'id': 'no_input_call'}] + if not re.findall(r'=[^\n]*?input', code): + return [{'id': 'no_input_call'}] + # if tokens * or / or = are not in code, we have to teach them how to # evaluate expressions. if (not has_token_sequence(tokens, ['/']) or |