diff --git a/build.py b/build.py new file mode 100644 index 0000000..5ae5980 --- /dev/null +++ b/build.py @@ -0,0 +1,14 @@ +''' Even number between 1 and 100''' +i=1 +while i <= 100: + 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 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 diff --git a/tests/__init__.pyc b/tests/__init__.pyc new file mode 100644 index 0000000..258f876 Binary files /dev/null and b/tests/__init__.pyc differ diff --git a/tests/test_solution.pyc b/tests/test_solution.pyc new file mode 100644 index 0000000..0fca3e7 Binary files /dev/null and b/tests/test_solution.pyc differ