Example:
Input: str = "\x41\x42\x43\x44" Output: str = "ABCD" Input: str = "This is \x49\x6E\x63\x6C\x75\x64\x65\x48\x65\x6C\x70" Output: str = "This is IncludeHelp"
Program:
# python program to assign hexadecimal values # to the string # declare and assign strings str1 = "\x41\x42\x43\x44" str2 = "This is \x49\x6E\x63\x6C\x75\x64\x65\x48\x65\x6C\x70" # printing strings print("str1 =", str1) print("str2 =", str2)
Output
str1 = ABCD str2 = This is IncludeHelp
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Program:
Output
need an explanation for this answer? contact us directly to get an explanation for this answer