In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
How to write the first line of python code, I believe that many inexperienced people do not know what to do, so this article summarizes the causes of the problem and solutions, through this article I hope you can solve this problem.
1. Create a new file
Under your project or under your own specified directory, create a new file named one.py.
Write the following in the file:
Print ("hello world")
Note: you can try to change the contents in quotation marks to something else.
two。 Run the code
Please run the code as before you are ready to start writing code in the directory of this book.
The running result is as follows, which is displayed in the development tool or on the command line:
Hello world
The result of the command line run is as follows:
The running result of the development tool is as follows:
3. Python function interpretation
4. Code interpretation description
Print refers to a function (syntax) of displaying, outputting and printing in Python language.
The main function of double quotation marks is to enclose the text to be displayed in double quotation marks.
Hello world is a sentence that I want to show. You can display any sentence that says: beijing Beijing is OK, too.
Change the content in the double quotation marks to something else, why don't you try it?
5. If you want to write in Chinese # coding=utf-8print ('Hello, World!')
Note:
The code part of Python should be written in English input method, not Chinese input method.
When we write the file abc.py, when we name the file, we only use these characters in English (a-zA-Z0-9 characters -) to name the file.
Do not use Chinese for naming files, do not use special symbols, and do not add spaces in the middle.
File names are strictly size sensitive.
After reading the above, have you mastered how to write the first line of python code? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.