Home > other >  Pure white for help: the py files directly into run CMD, prompt syntax error unicode error unicodees
Pure white for help: the py files directly into run CMD, prompt syntax error unicode error unicodees

Time:12-02

Problem a:
As shown in figure, the backslash to slash,
Can only understand grammatical errors, but running in the python shell is ok

The code in this:
Chance_num=0
Temp=input (' guess Numbers:)
Guess=int (temp)
While chance_num & lt; 3:
If guess & lt; 6:
Temp=input (" small small:)
Guess=int (temp)
The else:
If guess & gt; 6:
Temp=input (" big big:)
Guess=int (temp)
If guess==6:
Print (" very clever ")
Break

Chance_num +=1

If chance_num==3:
Print (' your opportunity has been used up ')
Print (' game over ')
Input ()

Problem two: think excuse me this code in the notepad, run directly enter the CMD display garbled, hint I press any key to continue after the direct flash back what reason be?

CodePudding user response:

Through the snow
refer to the original poster yellow reply:
problem a:
As shown in figure, the backslash to slash,
Can only understand grammatical errors, but running in the python shell is ok

The code in this:
Chance_num=0
Temp=input (' guess Numbers:)
Guess=int (temp)
While chance_num & lt; 3:
If guess & lt; 6:
Temp=input (" small small:)
Guess=int (temp)
The else:
If guess & gt; 6:
Temp=input (" big big:)
Guess=int (temp)
If guess==6:
Print (" very clever ")
Break

Chance_num +=1

If chance_num==3:
Print (' your opportunity has been used up ')
Print (' game over ')
Input ()

Problem two: think excuse me this code in the notepad, run directly enter the CMD display garbled, hint I press any key to continue after the direct flash back what reason be?

Is the problem encoding

CodePudding user response:

reference 1st floor Dream__xiaobei response:
Quote: refer to the building through the snow yellow reply:
problem a:
As shown in figure, the backslash to slash,
Can only understand grammatical errors, but running in the python shell is ok

The code in this:
Chance_num=0
Temp=input (' guess Numbers:)
Guess=int (temp)
While chance_num & lt; 3:
If guess & lt; 6:
Temp=input (" small small:)
Guess=int (temp)
The else:
If guess & gt; 6:
Temp=input (" big big:)
Guess=int (temp)
If guess==6:
Print (" very clever ")
Break

Chance_num +=1

If chance_num==3:
Print (' your opportunity has been used up ')
Print (' game over ')
Input ()

Problem two: think excuse me this code in the notepad, run directly enter the CMD display garbled, hint I press any key to continue after the direct flash back what reason be?

Is the problem encoding

Recommend you use VSCode or Pycharm

CodePudding user response:

File at the top of the add
 # - * - coding: utf-8 - * - 

CodePudding user response:

Thanks to two upstairs, has switched to VScode
  • Related