From 1db5b636325141db84e03f0a72a6e8cc7bcb2ee2 Mon Sep 17 00:00:00 2001 From: Martin Date: Tue, 29 Sep 2015 10:30:10 +0200 Subject: Small corrections to text; mostly changing plural form to singular. --- python/problems/introduction/fast_fingers_2/common.py | 11 +---------- python/problems/introduction/fast_fingers_2/sl.py | 18 ++---------------- 2 files changed, 3 insertions(+), 26 deletions(-) (limited to 'python/problems/introduction/fast_fingers_2') diff --git a/python/problems/introduction/fast_fingers_2/common.py b/python/problems/introduction/fast_fingers_2/common.py index 958940d..386e251 100644 --- a/python/problems/introduction/fast_fingers_2/common.py +++ b/python/problems/introduction/fast_fingers_2/common.py @@ -31,9 +31,6 @@ random.randint = lambda x, y: {} hint_type = { 'random': Hint('random'), - 'name_error': Hint('name_error'), - 'type_error': Hint('type_error'), - 'error': Hint('error'), 'if_clause': Hint('if_clause'), 'final_hint': Hint('final_hint') } @@ -91,13 +88,7 @@ def hint(python, code): exc = answer[0][3] exc_hint = get_exception_desc(answer[0][3]) # if have an exception! - if exc: - if 'NameError' in exc: - return [{'id':'name_error', 'args': {'message': exc}}] - elif 'TypeError' in exc: - return [{'id':'type_error', 'args': {'message': exc}}] - else: - return exc_hint + return exc_hint # First: if student does not import random, tell him about that module if not has_token_sequence(tokens, ['random']) or \ diff --git a/python/problems/introduction/fast_fingers_2/sl.py b/python/problems/introduction/fast_fingers_2/sl.py index 8e7dd47..6472442 100644 --- a/python/problems/introduction/fast_fingers_2/sl.py +++ b/python/problems/introduction/fast_fingers_2/sl.py @@ -65,26 +65,12 @@ hint = { 'if_clause': if_clause, - 'final_hint': '''\ + 'final_hint': ['''\

Odlično! Za konec pa še zanimivost. Pri tej nalogi stavka if niti ne potrebujemo, saj bi lahko napisali le:

 print(a*b == c)
 
-

kar bi izpisalo rezultat tega izraza. Poskusi!

''', +

kar bi izpisalo rezultat tega izraza. Poskusi!

'''] - 'name_error' : [mod.general_msg['error_head'], mod.general_msg['general_exception'], - mod.general_msg['name_error'], ''' -

Verjetno uporabljate spremenljivko, ki nima vrednosti. Ali v izrazu za izračun - uporabljate napačno spremenljivko? Ali pri izpisu morda poskušate - izpisati napačno spremenljivko?

'''], - - 'type_error' : [mod.general_msg['error_head'], mod.general_msg['general_exception'], - mod.general_msg['type_error'], ''' -

Verjetni razlog: funkcija input vrača vrednost tipa niz, -ki jo moramo najprej pretvoriti v tip float, če želimo z njo računati:

-
-v = float(input(" ...
-
-'''], } -- cgit v1.2.1