Alphabet Spam
This commit is contained in:
1 parent
3f3718d093
commit
523d14fefb
1 file changed
+21
@@ -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}")
|
||||
Reference in new issue
Block a user