This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
count = 0 | |
mylist = [] | |
while count < 5: | |
num = int(input()) | |
while num > 0: | |
mylist.append(num) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cnt1 = 1 | |
cnt2 = 0 | |
while cnt1 < 6: | |
while cnt2 < cnt1: | |
print('o' * cnt2, end='') | |
cnt2 = cnt2 + 1 | |
print('*') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
num1 = int(input()) | |
num2 = int(input()) | |
sum = 0 | |
for i in range(num1, num2 + 1): | |
sum = sum + i | |
print(sum) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in range(2, 10, 2): | |
for j in range(1, 10): | |
if j <= i: | |
print('%d X %d = %d' % (i, j, i*j)) | |
else: | |
continue | |
print() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in range(10): | |
for j in range(10): | |
result = (10*i + j) + (10*j + i) | |
if result == 99: print(i, j) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while True: | |
num = int(input()) | |
if (num < 3) or (num % 2 == 0): continue | |
space = int(num / 2) | |
for i in range(1, num, 2): | |
print(' ' * space + '*' * i) | |
space -= 1 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while True: | |
num = int(input()) | |
if num < 3 or num % 2 == 0: continue | |
dot = 1 | |
blank = int(num / 2) | |
while dot < num: | |
print(' ' * blank + '*' * dot) | |
dot += 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in range(2, 10): | |
for j in range(1, 10): | |
print('%d X %d = %d' % (i, j, i*j)) | |
print() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print("Hello World!") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
table = {"%20" : " ", | |
"%21" : "!", | |
"%24" : "$", | |
"%25" : "%", | |
"%28" : "(", | |
"%29" : ")", | |
"%2a" : "*"} | |
def convert(string): | |
for i in table.keys(): |