Compare commits
4 Commits
7af7bb41e5
...
8cb343b26f
| Author | SHA1 | Date | |
|---|---|---|---|
| 8cb343b26f | |||
| 523d14fefb | |||
| 3f3718d093 | |||
| edde2f011b |
21
alphabetspam.py
Normal file
21
alphabetspam.py
Normal file
@@ -0,0 +1,21 @@
|
||||
s = input()
|
||||
|
||||
uppercase = 0
|
||||
lowercase = 0
|
||||
whitespace = 0
|
||||
specials = 0
|
||||
|
||||
for c in s:
|
||||
if c == "_":
|
||||
whitespace += 1
|
||||
elif 65 <= ord(c) <= 90:
|
||||
uppercase += 1
|
||||
elif 97 <= ord(c) <= 122:
|
||||
lowercase += 1
|
||||
else:
|
||||
specials += 1
|
||||
total = len(s)
|
||||
print(f"{whitespace/total:.10f}")
|
||||
print(f"{lowercase/total:.10f}")
|
||||
print(f"{uppercase/total:.10f}")
|
||||
print(f"{specials/total:.10f}")
|
||||
15
ghostleg.py
Normal file
15
ghostleg.py
Normal file
@@ -0,0 +1,15 @@
|
||||
n, m = map(int, input().split())
|
||||
rungs = [int(input()) for _ in range(m)]
|
||||
|
||||
res = [
|
||||
0,
|
||||
] * n
|
||||
for element in range(1, n + 1):
|
||||
pos = element
|
||||
for r in rungs:
|
||||
if pos == r:
|
||||
pos += 1
|
||||
elif pos == r + 1:
|
||||
pos -= 1
|
||||
res[pos - 1] = element
|
||||
print("\n".join(map(str, res)))
|
||||
4
oddities.py
Normal file
4
oddities.py
Normal file
@@ -0,0 +1,4 @@
|
||||
n = int(input())
|
||||
for _ in range(n):
|
||||
x = int(input())
|
||||
print(f"{x} is {'even' if x % 2 == 0 else 'odd'}")
|
||||
Reference in New Issue
Block a user