I have recently started python and am having a frustratingly hard time trying to figure out how to print a raw string containing both ' and " characters. Even with various combinations of r'' and \ I cannot get python to return the literal string that I require.
Goal: Assign string of the following format to variable (similar format to be used as password). String: "1z8'aoVz1+9p}2C (16 character string starting with " and containing ').
Current result:
>>> string ='''"1z8'aoVz1+9p}2C'''
>>> string
'"1z8\'aoVz1+9p}2C'
>>> string =r'"1z8\'aoVz1+9p}2C'
>>> string
'"1z8\\\'aoVz1+9p}2C'
I have also tried splitting it into several variable and concatenating but python always returns the \ before '.
Thank you all for your help. I have learn a lot from this forum.