d8d292eaed34bbd968f4883ddf38721c68ef76b9

Author
Pavle Portic <pavle.portic@tilda.center>
Committer
Pavle Portic <pavle.portic@tilda.center>
Date

Message

Add alternating case script

Diff

 1diff --git a/dot_local/bin/executable_alternate b/dot_local/bin/executable_alternate
 2new file mode 100644
 3index 0000000000000000000000000000000000000000..fe0aa33c6fc3fa68f3c682916a7c9e73590651bd
 4--- /dev/null
 5+++ b/dot_local/bin/executable_alternate
 6@@ -0,0 +1,24 @@
 7+#! /usr/bin/env python
 8+# -*- coding: utf-8 -*-
 9+# vim:fenc=utf-8
10+#
11+# Copyright © 2020 <pavle.portic@tilda.center>
12+#
13+# Distributed under terms of the BSD 3-Clause license.
14+
15+text = input().lower()
16+case = True
17+output = ''
18+for c in text:
19+	if c in [',', '.', ' ', ':', '"', '\'']:
20+		output += c
21+		continue
22+
23+	if case:
24+		output += c.upper()
25+	else:
26+		output += c
27+
28+	case = not case
29+
30+print(output)