From d8d292eaed34bbd968f4883ddf38721c68ef76b9 Mon Sep 17 00:00:00 2001 From: Pavle Portic Date: Wed, 1 Apr 2020 16:25:30 +0200 Subject: [PATCH] Add alternating case script --- dot_local/bin/executable_alternate | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 dot_local/bin/executable_alternate diff --git a/dot_local/bin/executable_alternate b/dot_local/bin/executable_alternate new file mode 100644 index 0000000..fe0aa33 --- /dev/null +++ b/dot_local/bin/executable_alternate @@ -0,0 +1,24 @@ +#! /usr/bin/env python +# -*- coding: utf-8 -*- +# vim:fenc=utf-8 +# +# Copyright © 2020 +# +# Distributed under terms of the BSD 3-Clause license. + +text = input().lower() +case = True +output = '' +for c in text: + if c in [',', '.', ' ', ':', '"', '\'']: + output += c + continue + + if case: + output += c.upper() + else: + output += c + + case = not case + +print(output)