python 终止程序语法
In this tutorial we will try to understand the syntax of python programming. Although, syntax is something that you will understand as you will see more and more programs and examples, but there are a few things that you must know before hand.
在本教程中,我们将尝试了解python编程的语法。 虽然,随着越来越多的程序和示例,您将了解语法,但是您必须事先了解一些内容。
Python语法规则 (Python Syntax Rules)
Python is case sensitive. Hence a variable with name
yoyostudytonight
is not same asyoYoStudytonight
Python区分大小写 。 因此,名称为
yoyostudytonight
的变量与yoyostudytonight
yoYoStudytonight
For path specification, python uses forward slashes. Hence if you are working with a file, the default path for the file in case of Windows OS will have backward slashes, which you will have to convert to forward slashes to make them work in your python script.
对于路径规范,python使用正斜杠 。 因此,如果您使用的是文件,则在Windows操作系统中,该文件的默认路径将带有反斜杠,您必须将其转换为正斜杠才能使其在python脚本中正常工作。
For window's path
C:\folderA\folderB
relative python program path should beC:/folderA/folderB
对于窗口的路径
C:\folderA\folderB
相对的python程序路径应为C:/folderA/folderB
In python, there is no command terminator, which means no semicolon
;
or anything.在python中, 没有命令终止符 ,这意味着没有分号
;
或任何东西。So if you want to print something as output, all you have to do is:
因此,如果您希望将某些内容打印为输出,则只需执行以下操作:
print ("Hello, World!")
Oops! we just shared the first python program too with you. Yes, just one single statement.