Difference between revisions of "Code Snippet: Changing Character Case"
From Coder Merlin
NerdOfLinux (talk | contribs) |
|||
Line 9: | Line 9: | ||
== Python == | == Python == | ||
<syntaxhighlight lang="Python"> | |||
string = "For the world is hollow, and I have touched the sky!" | |||
print(string.upper()) | |||
print(string.lower()) | |||
</syntaxhighlight> |
Revision as of 17:28, 24 December 2018
Within these castle walls be forged Mavens of Computer Science ...
— Merlin, The Coder
Print characters in uppercase or lowercase[edit]
Swift[edit]
let string = "For the world is hollow, and I have touched the sky!"
print(string.uppercased())
print(string.lowercased())
Python[edit]
string = "For the world is hollow, and I have touched the sky!"
print(string.upper())
print(string.lower())