From 84f3426c937d1bb9d44ba25a71706416fbb8b85d Mon Sep 17 00:00:00 2001 From: Martin Date: Fri, 9 Oct 2015 11:17:49 +0200 Subject: Added several new problems. They have no tests nor hints implemented. --- python/problems/functions/friendly_numbers/sl.py | 37 ++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 python/problems/functions/friendly_numbers/sl.py (limited to 'python/problems/functions/friendly_numbers/sl.py') diff --git a/python/problems/functions/friendly_numbers/sl.py b/python/problems/functions/friendly_numbers/sl.py new file mode 100644 index 0000000..d1c15ff --- /dev/null +++ b/python/problems/functions/friendly_numbers/sl.py @@ -0,0 +1,37 @@ +# coding=utf-8 +import server +mod = server.problems.load_language('python', 'sl') + + +id = 233 +name = 'Prijateljska števila' +slug = 'Prijateljska števila' + + +description = '''\ +

+220 in 284 sta prijateljski števili. Delitelji 220 so 1, 2, 4, 5, 10, 11, 20, 22, 44, 55 in 110. +Če jih seštejemo, dobimo 284. Delitelji 284 pa so 1, 2, 4, 71 in 142. Vsota teh števil pa je 220. +Napiši funkcijo friendly_number(n), ki vrne prijateljsko število številu n, če ga ima, oz. +vrne None, če ga nima. Primer: +

+>>> friendly_number(220)
+284
+>>> friendly_number(222)
+None
+
+

+

Uporabite funkcijo za vsoto deliteljev!

''' + +plan = ['''\ +

+''', + '''\ +

'''] + +hint = { + 'final_hint': ['''\ +

Program je pravilen!
+

+'''], +} -- cgit v1.2.1 From 95e107bf9e6a288969e4a83aee1a7062990f3b67 Mon Sep 17 00:00:00 2001 From: Martin Date: Fri, 9 Oct 2015 16:35:23 +0200 Subject: Fixed testing for most problems. --- python/problems/functions/friendly_numbers/sl.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'python/problems/functions/friendly_numbers/sl.py') diff --git a/python/problems/functions/friendly_numbers/sl.py b/python/problems/functions/friendly_numbers/sl.py index d1c15ff..51d47ae 100644 --- a/python/problems/functions/friendly_numbers/sl.py +++ b/python/problems/functions/friendly_numbers/sl.py @@ -12,12 +12,12 @@ description = '''\

220 in 284 sta prijateljski števili. Delitelji 220 so 1, 2, 4, 5, 10, 11, 20, 22, 44, 55 in 110. Če jih seštejemo, dobimo 284. Delitelji 284 pa so 1, 2, 4, 71 in 142. Vsota teh števil pa je 220. -Napiši funkcijo friendly_number(n), ki vrne prijateljsko število številu n, če ga ima, oz. +Napiši funkcijo amicable_number(n), ki vrne prijateljsko število številu n, če ga ima, oz. vrne None, če ga nima. Primer:

->>> friendly_number(220)
+>>> amicable_number(220)
 284
->>> friendly_number(222)
+>>> amicable_number(222)
 None
 

-- cgit v1.2.1