After installing the latest version of the Python 3.x version,To refer to someone else's code (based on a Python 2.x writing tutorial), to use the print function, when the output is printed, the result is a syntax error with the PRINT
Baptism of the soul, practice python (3) -- expose coding problems, operating principles and syntax habits from a simple print code, pythonprint
After the preliminary work is ready, you can open the IDE editor. You can select the built-in python
(C syntax) print the number of days in a month, syntax 17
Knowledge point:
Flexible use of logical expressions
Method 1:
Switch () usage, pay attention to the use of case 'A ':......; Break; case 6 :......; Break;
Do not forget break;
Method 2:
If ..
I have just installed python on windows and want to print the string, but I keep reporting an error (python 3.3. 2)
>>> Print helloSyntaxError: invalid syntax>>> Print 'hello'SyntaxError: invalid syntax>>> Print "hello"SyntaxError: invalid syntax>>>
Print! Print! Print !, Print
Print statements can be printed, which is only an interface that is friendly to programmers for standard output streams.
Technically, this is to convert one or more objects into their text expressions and then send
Transferred from: http://www.codingpy.com/article/why-print-became-a-function-in-python-3/In Python 2, print is a statement (statement), and in Python 3 it becomes a function. Many Python users ask, why is Python 3 turning print into a function?
The use of python3.3, Baidu has been checked because of the version of the problem. But I do not have a companion to study the document AH. Who can offer me a copy? How do you write Hello World under python?
Reply content:After Python 3, print is
defFun (): forXinchRange (4): Print(x) fun ()#Call the fun function, print all results-(Result: 0,1,2,3)defFun (): forXinchRange (4): returnXfun ()#Call the fun function, return the value returned in the function, the caller cannot see-
1. Echo Statement2. Print StatementsThe difference between the twoecho-capable of outputting more than one string, no return valuePrint-can only output one string and return a value of 1echo is faster than print at run time because it has no return
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.