Posts

Showing posts from June, 2016

Python Interview Programs

Disclaimer – There are always multiple approaches to solve a problem. We have used only one out of those. You can try other logic based on your understanding. Please comment your concern to us, we may help you in your understanding on Python Programming. Allthe programs below are center indented. Please type it while implementing in py. 1.        Write a program to print a string in Python ? Ans –  Strings can be printed using double quotes or single quote. Please refer the below example for trying dfferent variables. a = "Hello World" print a Output : python main.py Hello World The choice between single and double quotes often comes down to convenience, especially when your string contains quotes. For example: If your string contains a single quote, you might use double quotes to avoid escaping: print("It's a beautiful day!") Conversely, if your string contains double quotes, you might use single quotes: print('He said, "Hello!"...