Add alternating case script

This commit is contained in:
Pavle Portic 2020-04-01 16:25:30 +02:00
parent 22d5c85a40
commit d8d292eaed
Signed by: TheEdgeOfRage
GPG Key ID: 6758ACE46AA2A849
1 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,24 @@
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2020 <pavle.portic@tilda.center>
#
# 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)