Python Programming Language – HELLO WORLD
In order to comprehend the syntax of Python, we will begin with a very simple programme. When learning a new programming language, it is conventional to begin with a Hello World application. A Hello World application is simply a script that displays the text "Hello World!" This is especially simple in Python. print("Hello World!") As can be seen, this is a single-line Python programme. In other programming languages, printing a single text would necessitate defining a basic structure with functions, classes, and more. However, let's observe what is occurring. The very first thing we notice is the so-called function named print. This function outputs specific text to the screen when invoked. The text to be printed must be placed between the parentheses. Additionally, the quotation marks are a crucial element here. They indicate that the text is a string rather than a proper name. A string represents text as a data type. Without quotation marks, the interpreter will consider Hello World! to be a variable name and not a text. 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
|