How to reverse an int in python? -
I am creating a dragon script which prints the '99 bottles the whole song of the bottle, but is inverted. The only thing that I can not reverse is the number, the integer is not the string.
This is my complete script, I understand that my reverse function argument Takes a string as though I do not know how to take an integer, or, how can I change an integer later in the script You are conveying it in a very strange way. You already have a reverse task , Then why not that runs in this way: Then return the result to This makes it easy to check and see each part of the code separately What is happening when you put it together. def reverse (str): return str [:: -1] DERT plural (word, b): If B! = 1: return word + 'a': return word defline (b, ending): print be or reverse ('no'), plural (reverse 'bottle'), b), range (1 99 0, -1 ) Reverse (ending): line (i, "beer on the wall") line (i, "beer" print reverse ("lo
line make the line line normal way ?
def line (bottles, ends): "{0} { Return to "{2}." Format (bottles, plural ("bottle", bet les), closing)
Beer 49 bottles on the wall.
reverse Pass on :
& gt; & Gt; & Gt; Reverse (49 ("beer on the wall" (line, 49) 'llaw eht no reeb fo selttob 94' '
Comments
Post a Comment