Skip to main content

Python program that shifts the given alphanumeric string by a certain offset.

This Python program shifts the inputted string forward and backward by a certain offset number 'n' that can be negative or positive integer. This integer ranges from +25 to -25. However, there is a minor error in this program which is left up to the viewer for rectification.
The output of the program is shown below:

Comments

Popular posts from this blog

A simple Python program for parsing Amazon to display requried product list with price

You need two packages in Python : 'lxml' and 'requests' in order to perform the parsing. Actually, we use a template url of Amazon in order to find the content that we require. We attach the template url with the keyword that is inputted from the user (in this case, 'headsets' is being used as the default string to search). After that, there comes the role of XPath for parsing the web-content according to the html tags being used over there. You can learn a lot by seeing this simple example:   Output: However, you might be agitated because this code though is correct, might produce null output because of Response = 503 which tells that there is no connection with your computer and the website server that you want to withdraw the data. In order to smoothly run, you may need to modify the code as: