How do I type the symbol "¿" in Python 2.7?

0

How can you write the symbol "¿" in a manageable text string in Python 2.7?

    
asked by Juan Carlos 09.12.2016 в 01:29
source

2 answers

1

Add the following lines to the beginning of the file to be able to use UTF-8 in strings and comments:

#!/usr/bin/python
# -*- coding: utf-8 -*-

link

    
answered by 09.12.2016 в 01:45
0

You must add the coding in the first lines, for that matter the encoding would be utf-8. The following example will print the "How is it going with Python?".

#!/usr/bin/python
# -*- coding: utf-8 -*-
texto = "¿Como va todo con Python?"
print texto

I hope I have helped you, Regards.

    
answered by 09.12.2016 в 03:25