Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add files via upload #168

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
6 changes: 6 additions & 0 deletions ruchi/assignment1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
rows=5
for i in range(rows, 0, -1):
for j in range(0, i + 1):
print("", j, end='')
print("\n")

14 changes: 14 additions & 0 deletions ruchi/assignment10.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
rows = int(input("Enter number of rows:"))
k = 0
for i in range(1, rows + 1):
for space in range(1,(rows - i)+1):
print(" ", end=" ")
while k!=(1*i-1):
print(" ", "* ", end="")
k += 1
k = 0
print()




12 changes: 12 additions & 0 deletions ruchi/assignment11.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
rows = 5
for i in range(0, rows):
for j in range(0, i + 1):
print("", "*", end='')
print("")
print("")
rows = 5
for i in range(rows + 1, 0, -1):
for j in range(0, i - 1):
print("", "*", end='')
print("")

11 changes: 11 additions & 0 deletions ruchi/assignment12.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
rows = 5
for i in range(0, rows):
for j in range(0, i + 1):
print("", "*", end='')
print("")
rows = 5
for i in range(rows + 1, 0, -1):
for j in range(0, i - 1):
print("", "*", end='')
print("")

20 changes: 20 additions & 0 deletions ruchi/assignment13.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
rows = 5
k = 2 * rows - 2
for i in range(0, rows):
for j in range(0, k):
print(end=" ")
k = k - 2
for j in range(0, i + 1):
print("* ",end="")
print("")
i = 1
while (i <= rows):
j = 1
while (j <= rows):
if(j < i):
print('', end='')
else:
print('*', end='')
j = j + 1
i = i + 1
print()
2 changes: 2 additions & 0 deletions ruchi/assignment14.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
rows = 14
print("*")
10 changes: 10 additions & 0 deletions ruchi/assignment2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
rows=5
i = 1
while i <= rows:
j=1
while j <= i:
print("", (i * 2 - 1), end="")
j = j + 1
i = i + 1
print("\n")

6 changes: 6 additions & 0 deletions ruchi/assignment3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
rows=6
for i in range(1, rows):
for j in range(i, 0, -1):
print("", j, end='')
print("\n")

11 changes: 11 additions & 0 deletions ruchi/assignment4.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
start = 1
stop = 2
current_num = stop
for row in range(2, 6):
for col in range(start, stop):
current_num -= 1
print("", current_num, end='')
print("")
start = stop
stop += row
current_num = stop
17 changes: 17 additions & 0 deletions ruchi/assignment5.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
def print_pascal_triangle(size):
for i in range(0, size):
for j in range(0, i + 1 ):
print("", decide_number(i, j), end="")
print('')

def decide_number(n, k):
num = 1
if k > n - k:
k = n + k
for i in range(0, k):
num = num * (n)
num = num // (i + 1)
return num
#set rows
rows = 7
print_pascal_triangle(rows)
9 changes: 9 additions & 0 deletions ruchi/assignment7.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
rows = 8
# rows = int(input("enter the number of rows"))
for i in range(1, rows + 1):
for j in range(1, i + 1):
#multiplication current column and row
square = i * j
print("", i * j, end='')
print()

10 changes: 10 additions & 0 deletions ruchi/assignment8.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
rows = 5
k = (2 * rows) - 2
for i in range(rows, -1, -1):
for j in range(k, 0, -1):
print(end="")
k = k + 1
for j in range(0, i + 1):
print("*", end="")
print("")

10 changes: 10 additions & 0 deletions ruchi/assignment9.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
rows = int(input("Enter number 0f rows:"))
for i in range(rows, 1, -1):
for space in range(0, rows-i):
print(" ", end="")
for j in range(i, 1*i-1):
print("", "* ", end="")
for j in range(0, i - 1):
print("", "* ", end="")
print("\n")

11 changes: 11 additions & 0 deletions ruchi/asssignment6.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
rows = 5
for i in range(1, rows + 1):
for j in range(1, rows + 1):
if j <= i:

print("", i, end='')
else:
print("", i, end='')

print('\n')

8 changes: 8 additions & 0 deletions ruchi/first program.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
rows=5
num=rows
#reverse for loop
for i in range(rows,0,-1):
for j in range(0,i):
print("", num,end='')
print("\n")