This file contains 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
s=input().replace(" ","") | |
f={v:0 for v in s} | |
for c in s:f[c]+=1 | |
print(max(f.values())) |
This file contains 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
n = input() | |
characters = input() | |
character = characters.split(" ") | |
a = [] | |
for i in character: | |
a.append(chr(int(i))) | |
print("".join(a)) |
This file contains 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
def asterix_triangle(i, t=0): | |
if i == 0: | |
return 0 | |
else: | |
print((" " * n)[:-2] + ' ' * ( i + 1 ) + '*' * ( t * 2 + 1 )) | |
return asterix_triangle( i - 1, t + 1 ) | |
def asterix_triangle2(i, t=0): | |
if i == 0: | |
return 0 |
This file contains 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
f,s=input().split() | |
d=0 | |
for i in range(len(f)): | |
if f[i]!=s[i]:d+=1 | |
print(d) |
This file contains 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
x=int(input()) | |
for i in int(input()): | |
f,c,t=input().split() | |
if int(f)<=x<=int(c):print(t) |
This file contains 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
n=input() | |
o={'A':'4','B':'8','C':'(','D':'|)','E':'3','F':'|=','G':'6','H':'|-|','I':'!','J':'_|','K':'|<','L':'1','M':'/\\/\\','N':'|\|','O':'0','P':'|>','Q':'9','R':'/2','S':'5','T':'7','U':'|_|','V':'\/','W':'\/\/','X':'}{','Y':'\'/','Z':'2'} | |
string="" | |
for i in n: | |
if i.upper() in o: | |
string+=o[i.upper()] | |
else: | |
string+=i | |
print(string) |
This file contains 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
past = "" | |
n = 0 | |
for word in input().split(" "): | |
for letter in word: | |
if letter != " ": | |
if letter.lower() == past.lower(): | |
n+=1 | |
break | |
past = letter | |
past = "" |
This file contains 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(input()):print bin(input())[2:] |
This file contains 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
a, b = [int(i) for i in input().split()] | |
n = int(input()) | |
for i in range(n): | |
x = int(input()) | |
print(x*a+b) |
This file contains 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
n = int(input()) | |
if n!= 1: | |
string = "" | |
for i in range(n): | |
string +="#" | |
print(string) | |
for i in range(n-2): | |
print('#'+ " "*(n-2) + "#") | |
print(string) | |
else: |