Skip to content

Instantly share code, notes, and snippets.

@nharrell04
Created April 6, 2013 18:13
Show Gist options
  • Save nharrell04/5327038 to your computer and use it in GitHub Desktop.
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, …
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