Created
April 6, 2013 18:13
-
-
Save nharrell04/5327038 to your computer and use it in GitHub Desktop.
INSTRUCTIONS
Write a for loop to go through the characters of the string s and print them. However! If a character is an 'A' or an 'a', print a capital 'X' instead.
Note: You'll want to follow the thing you're printing with a comma (,) to prevent your output from including newlines. Check the Hint for more!
Hint
You can use the same for syntax, …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
s = "A bird in the hand..." | |
# Add your for loop | |
for x in s: | |
if x == "A" or x == "a": | |
print "X", | |
else: | |
print x, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment