Python Programming Language - First Python Programme
We will begin with a very basic first programme in order to understand the syntax of Python. When learning a new programming language, it is customary to begin with a Hello World application. "HELLO WORLD!" A script that prints "Hello World!" to the screen is all that a Hello World application is. This is especially easy to do in Python. "Hello World!" is printed. This is a Python one-liner, as you can see. To print a single text, we would need to design a fundamental structure in another language, complete with functions, classes, and more. However, let's investigate this situation. The so-called function with the name print is the first thing that stands out. When we utilise that function, a specific text is displayed on the screen. We must place the text we want to print between the brackets. The use of quote marks is another crucial component in this. They serve as a reminder that the text is a string and not the name of another object. A data type that represents text is a string. Without quotation marks, the interpreter will believe that Hello World! is a variable name rather than a text and will behave accordingly. Consequently, we will receive an error message.
0 Comments
Leave a Reply. |
AuthorAnything you need to know about computer science Archives
May 2023
Categories
All
|