I'm writing a book for beginners that shows the zodiac signs when you get older.
year_str=input('Please enter the year of your birth in four digits:') year=int(year_str) number_of_eto=(year+8)%12 print('Your zodiac sign is',number_of_eto,').')
if you write
Please enter the year of your birth in 4 digits:
and enter the year
If it's a book, your zodiac sign should say ~, but is there something wrong with the way you wrote it?❓python python3
If you are using Python 3, this code should print correctly.However, Python 2 prints a string with a lot of backslashes escaped, as shown in the questionnaire.This is related to a change in the way strings are encoded in the program starting with Python 3.0.
So please check your Python version first.For example, you can verify this by entering the following command at the terminal:
If Python 2.x is installed, that is the reason.There are several solutions.
python3command exists, use it instead of the
pythoncommand.This is a command to run Python 3.x series.
367 To Limit Column Values to Strings in a String List Using sqlalchemy
354 I have saved several codes written in python to a visual studio file.
340 Scrap text information after the "View More" button when searching in the Yahoo! News search window
356 I want to create an array of sequences from "1" to a specified number.
© 2023 OneMinuteCode. All rights reserved.