Write a program to convert a string written as JAVA variable to C++ variable and vice-versa. Input : this_is_a_variable Output: thisIsAVariable
Utilisateur anonyme
new_s = "" i = 0 while i < len(s): if s[i] == "_": new_s = new_s + (s[i] + s[i + 1]).replace(s[i] + s[i + 1], s[i + 1].upper()) i = i + 2 else: new_s = new_s + s[i] i = i + 1 print(new_s)