Alphabet Spam
This commit is contained in:
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}")
|
||||||
Reference in New Issue
Block a user