- Daily Competitions
- On Want Questions
- Campaign
- Other Ideas???
#Title
Counting Up
#Statement Write a program that takes a {{String}} as it's input and outputs a [[String]] as output based on several factors:
- If the [[character]] is an upper-case letter [A-Z] then print out the letters [A-[[character]]].
- If the [[character]] is a lower-case letter [a-z] then print out the letters [a-[[character]]].
- If the [[character]] is a digit [0-9], then print out the numbers [0-[[character]]]
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
| import collections | |
| s = "".join(input().split()) | |
| print(collections.Counter(s).most_common(1)[0][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
| string="zyxwvutsrqponmlkjihgfedcba" | |
| string2="abcdefghijklmnopqrstuvwxyz" | |
| a="" | |
| for i in input(): | |
| a+=string[string2.index(i)] | |
| print(a) |
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
| from itertools import starmap, cycle | |
| i,o=input,ord | |
| def d(c,k):return(chr(((o(c)-o(k))%26)+o('a'))," ")[c==" "] | |
| print("".join(starmap(d,zip(i(),cycle(i()))))) |
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
| def get_octant(x,y): | |
| try: | |
| if abs(x)/abs(y) == 1: | |
| return "undefined" | |
| except: | |
| return "undefined" | |
| dx, dy = x,y | |
| octant = 0 | |
| if dy < 0: | |
| dx, dy = -dx, -dy # rotate by 180 degrees |
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
| import sys | |
| import math | |
| # Auto-generated code below aims at helping you parse | |
| # the standard input according to the problem statement. | |
| id_badge =[] | |
| seen = [] | |
| n = int(input()) | |
| for i in range(n): | |
| id_badge.append(input()) |
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
| x=int(input()) | |
| if bin(x)[2:].count("1") == len(bin(x))-2: | |
| print("true") | |
| else: | |
| print("false") |
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
| n,d=int(input()),"123456789" | |
| for i in range(n):print("+"*i+d[:n-i]) |
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
| import sys | |
| import math | |
| # Auto-generated code below aims at helping you parse | |
| # the standard input according to the problem statement. | |
| x=[] | |
| n = int(input()) | |
| for i in range(n): | |
| x.append(int(input())) | |
| def f7(seq): |