Capitalise every other letter in a string in Python?

I’ve been trying to define a function that will capitalise every other letter and also take spaces into accout for example: print function_name(“Hello world”) should print “HeLlO wOrLd” rather than “HeLlO WoRlD” I hope this makes sense. Any help is appreciated. Thanks, Oli Answers: Thank you for visiting the Q&A section on Magenaut. Please note … Read more

Using print statements only to debug

I have been coding a lot in Python of late. And I have been working with data that I haven’t worked with before, using formulae never seen before and dealing with huge files. All this made me write a lot of print statements to verify if it’s all going right and identify the points of failure. But, generally, outputting so much information is not a good practice. How do I use the print statements only when I want to debug and let them be skipped when I don’t want them to be printed?