Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions build.py
Original file line number Diff line number Diff line change
@@ -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
13 changes: 13 additions & 0 deletions square_of_numbers.py
Original file line number Diff line number Diff line change
@@ -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
Binary file added tests/__init__.pyc
Binary file not shown.
Binary file added tests/test_solution.pyc
Binary file not shown.