-1
I was wondering how I can manipulate Python characters. In C, I can do this by adding 1 to a character, if I type "a" for example, it adds 1, and "a" will become "b". Example:
char string[20];
printf ("Digite uma String: ");
scanf ("%19[^\n]", string);
int i;
for (i = 0; i < strlen(string); i+=1)
{
string[i] += 1;
}
Is there any way I could do something similar in Python? I know there are functions to turn the minuscule letter to upper case and vice versa, but I really wanted to change the letters according to the Ascii Table, change the characters of a string, one by one. You could manipulate the characters of a python string the same way I manipulate in C?
Although I don’t think this is one of the best questions on the site, I don’t see anything that justifies its closure. I voted to reopen.
– Victor Stafusa