2019년 9월 5일 목요일

Python[1 day]: First Python programming [print( ) function and variable]

   This post assumes that Python over Ver. 3.0 is already installed on your computer, otherwise you can visit https://www.python.org/ for Python installation.
   The most important thing for beginners to learn programming is to find it interesting. Maybe, a good way to do this is to learn programming by checking the output, just before he input some commands into a computer, displayed on a monitor.
   This post gives a brief overview of print function that makes the commands entered by the user appear on the monitor for whom wants to learn Python.

   print ( ) function displays your commands inserted in ( ) on a monitor.


   The mark of >>> on your monitor is the Python prompt, which will wait and do nothing before you input any other command. When you input any command, you never insert blank just after the prompt of >>>.



   If you want to display your words or a sentence on a monitor, you should use the quotation marks of “~~” or ‘~~’. If you don’t use the quotation marks with print function for displaying any word or sentence, you will see certainly an error message.


   If you want any numeric value, character, word or sentence into any place of memories of a computer, you should assign the name of any specific memory space of a computer for your input data. We call the name of the specified memory space a variable. However, we don’t need to care how the memory space is assigned and where the memory space is for the variable. Just keeping in mind is that the variable is the name of a memory space for assigned for any input data.



   You can also store your words or sentence into the variable named by you. However, you should use the quotation marks when you assign a string to a variable. Now, we look into the process that the data is assigned to a variable.
   If you type x=5, Python interpreter will secure any memory space and named x for that memory. After being secured a memory, the value of 5 is recorded into that memory. Therefore, the equality mark of = is quite different of mathematics as seen the following example.


댓글 없음:

댓글 쓰기