In python there is no direct function to reverse a string, to reverse a string we need to use slicing.
A slice extracts elements based on a start.
An extended slice extracts elements based on start and stop with step/stride.
Some examples of slicing:
Recently Filip Krikava made a fork on github and created a Juno branch using the latest commit +Fix the problem when an image is not located in the local docker image registry ( https://github.com/fikovnik/nova-docker/commit/016cc98e2f8950ae3bf5e27912be20c52fc9e40e )
The Test Day for 4.5 RC4 has been set for this Wednesday, December 17, 2014.
Test Days insure that the upcoming release is ready for production. It also allows all users to test out the upcoming release in their own environment.
When contributing to open source projects, it’s pretty common these days to fork the project on Github, add your contribution, and then send your work as a so-called “pull request” to the project for inclusion. It’s nice, clean and fast. I did this last week to contribute to Apache CloudStack. When I wanted to contribute […]
Assume you have a complex bash script named 'run_q.sh' (containing good number of loops, Awk statements, multiple lines of code etc) that you need to run against one or more remote servers via SSH. One way would be to copy (i.e. scp) the script to the remote server(s) and then do something like this: e.g. $ scp -2 run_q.sh email@example.com:/tmp/.$ ssh -2 firstname.lastname@example.org sh /tmp/run_q.sh
A few weeks ago, I went onto a road trip to China with the aim to meet Xen Project users as well as contributors. When I was planning the trip, it became apparent that many of the developers in China are new to the project and had difficulties with Xen Project governance and how the project operated. As we also have had issues with increasing code review times due to a large influx of new developers, I put together some comprehensive training package targeted at new community members.
By using is isinstance(var, type) function we can check a given value/variable is integer or not. isinstance will either written True or False.
Here is and an example:
>>> isinstance(10, int)
>>> isinstance(var_a, int)
>>> isinstance('a', int)
To check if variable is a number use following example: