From abfd86241b83db3eedfd7ea4420d4a03011ab19b Mon Sep 17 00:00:00 2001 From: jmcode79 Date: Mon, 28 Aug 2017 14:44:35 +0000 Subject: [PATCH 1/3] Done --- build.py | 6 ++++++ tests/__init__.pyc | Bin 0 -> 157 bytes tests/test_solution.pyc | Bin 0 -> 678 bytes 3 files changed, 6 insertions(+) create mode 100644 build.py create mode 100644 tests/__init__.pyc create mode 100644 tests/test_solution.pyc diff --git a/build.py b/build.py new file mode 100644 index 0000000..4aaa0d9 --- /dev/null +++ b/build.py @@ -0,0 +1,6 @@ +''' Even number between 1 and 100''' +i=1 +while i <= 100: + if i%2 == 0: + print i + i=i+1 diff --git a/tests/__init__.pyc b/tests/__init__.pyc new file mode 100644 index 0000000000000000000000000000000000000000..258f876c919dc23b8aa38b1afa61e05db2107892 GIT binary patch literal 157 zcmZSn%*&`WgATsrp&D$@wX% z=9c>5`9;~q1&PV2`XB-Q%)FAKeBF|K-Ga)JjQl*^q{QOP+-29Z%oK!oIg~dS3004@VB+~!@ literal 0 HcmV?d00001 diff --git a/tests/test_solution.pyc b/tests/test_solution.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0fca3e787e21621165822f97e5c15c10bd90feea GIT binary patch literal 678 zcmcIg!Ab)$5S?_ZNU@-QQ1G${b&n#5h&>8DYzxv}!n#T6*4<6n$sPo6_3T&r2Y!IQ z$(H&B4Vg(Y^O*PYqMza5>icVv(|$!b9}#?wWUv*LM3thYB4v7H6|EGRh(3vSM2lsQ zOrK`)3E;&qR;+OIXGn9)ev+~E=ljRZm8~yaeIOI)6M`?1EC~lFF&R_SS(uayMxuw9 zAOiM-XcM&UL=}Nw+SAYz+EET(9&IybYdS>(0OZ;DdDGgi)|YvN6r)(w zl8VLbV3pQ&R#~mRsMNZ0rY-SIMc}` Date: Mon, 28 Aug 2017 14:46:39 +0000 Subject: [PATCH 2/3] Done --- build.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/build.py b/build.py index 4aaa0d9..5ae5980 100644 --- a/build.py +++ b/build.py @@ -4,3 +4,11 @@ if i%2 == 0: print i i=i+1 +# Generate Fibonacci series upto 10 + +a,b = 0,1 +print a,b +for i in range(0,15): + c = a+b + a,b=b,c + print c From f43b8d525d933bf5fb6d9680f26608b9e5e6fceb Mon Sep 17 00:00:00 2001 From: jmcode79 Date: Mon, 28 Aug 2017 14:49:19 +0000 Subject: [PATCH 3/3] Done --- square_of_numbers.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 square_of_numbers.py diff --git a/square_of_numbers.py b/square_of_numbers.py new file mode 100644 index 0000000..145937f --- /dev/null +++ b/square_of_numbers.py @@ -0,0 +1,13 @@ +'''With a given integral number n, write a function to generate a dictionary that contains (i, i*i) + such that is an integral number between 1 and n (both included). + + Number should not be less than 0 and should not be greater than 100. + Calculate square of all number from 1 to n and store in dict. + Function should pass all test cases ''' + +x = input ( " Enter a number between 0 and 100: ") +if x <= 0 or x > 100: + print "Number invalid" +else : + S = {item:item*item for item in range(x)} +print S