Computer Learning

All About Computer And Technology

  • Home
  • Python Programming
    • How To Find Maximum And Minimum Value On Python Programming Language
    • Creating Tuple, List, and Dictionary on Python Programming Language
    • Learning about Input value using Python easily
    • Creating Function on Python Programming Language
    • Read More >>
  • Komputer
    • Program Execution (Organization and Architecture Computer)
    • Microcontroller of Von Neumann vs Havard and CISC vs RISC
    • Definition and Function of Control Unit
  • Blog Tutorial
    • How to Make Table of Content with Sroll in Blogspot
    • How to make Claim or Get Verification Our Blogs to Alexa
  • Tips dan Trik
    • How To Solve Red Cross In Blackberry
    • How to Restore Deleted File in Smartphone Memory Using Recuva
    • Selengkanya >>
  • Contact Me
Home » Python Programming Language » Learning about Input value using Python easily

Learning about Input value using Python easily

Joni
Add Comment
Python Programming Language
Thursday, July 24, 2014


Finally, we can meet again in my blog friends, I’m happy to meet you. I just want to share what I know about Python Programming Language. Actually I need your comments about my writing especially for you who are master of Python Programming Language. Although my writing is not perfect, but I hope it is useful for you especially for newbie to learn about Python Programming Language. At least, you can know about what the bases of Python Programming Language. I will began this material below :
  1. This material discuss about how programmer write codes so that users can input a value and the value can be processed by Python.
    What kind of this function to do it ?Python provides input or raw_input function. For Python with version 3 up is using input whereas Python with version 3 down is using raw_input.How to use this ?Example : ( I use Python version 2.7)a = raw_input(“Your statement : ‘string’”)
    print a It will print string which filled by users.
    Note : in formula above, string will be filled by users not programmer, so let it be empty.
    See the example below :


    Why I use “+” when joining var a and var b with the string ?Because it is right that joining between string and string on Python using “+” . It is different when we will join between integer and string. It will be learned after this. Let’s we continue this first my friends.Then, user must fill or input string. See the Interactive Mode of the program above after executing :


    Need to know when you write script after print, if something that you print is string or statement, the string must use quotes (“ “ ). But if something that you print is variable, you don’t need using quotes (“ “).
  2. The next material is inputting integer and the value will be joined with string.What’s the meaning ?I will explain it to you. For example, user is asked by a program like this “How many your ages?” it means that user is asked to input integer. You still remember right my writing that I had written before about Learning about Bases of Python Programming Language for Newbie. I believe that you still remember, hehe.. We back to our topics, so how programmer should write scripts so that user can input integer ? the answer is converting from string into integer. Then, how ?On the first material, we have written :a = raw_input(“Your statement : ‘string’”) Now, to convert string into integer , we should add int in the behind of raw_input. Just see the formula below :a = int(raw_input(“Your statement : ‘integer’”))
    print aDon’t forget to write double closing bracket in the behind because there are two opening brackets. Many people who forget about that.
    And the next topic is how to join string with integer. We should use comma (,) between string and integer.See the example below :

    The Interractive Mode of the program above after executing :

  3. OK, the last topics if we convert from string into float.The writing is almost same with converting string into integer. See the formula below :a = float(raw_input(“Your statement : ‘float’”))
    print aThe function is when you want user input decimal number. For example, you ask user like this “How tall you are ? “ in this case, user must input decimal number.See the example below :

    The interactive Mode of the program after executing :
It is easy right ? heheIt will be easy if you have hard intention to learn programming language. This is base of Python learning friends. You need to learn more and more to be expert programmer. That’s all for today, and wait for my next writing.
Thanks for your visiting
Tweet
Learning about Input value using Python easily Title : Learning about Input value using Python easily
Description : Finally, we can meet again in my blog friends, I’m happy to meet you. I just want to share what I know about Python Programming Languag...
Rating : 5

0 Response to "Learning about Input value using Python easily"

Post a Comment

← Newer Post Older Post → Home
Subscribe to: Post Comments (Atom)

Popular Post

  • Program Execution (Organization and Architecture Computer)
    How to read this figure below ?  Notes  : Program Counter (PC) = Address of Instruction  Instruction Register (IR) = Ins...
  • How to Write Matematics Formulas on Python Programming Language
    Good night all programmers?  As my writing before about Learning if, for, and while function on Python Programming Language, I wil...
  • Microcontroller of Von Neumann vs Havard and CISC vs RISC
    Microcontroller of Von Neumann vs Havard and CISC vs RISC | pemprograman | komputer | bahasa python Microcontroll...
  • How to Use If, For, and While on Python Programming Language
    Welcome back to my page guys !    I’m happy to meet you again my friends because you all are the next generation on this country. We ...
  • How To Find Maximum And Minimum Value On Python Programming Language
    On my writing before, you have learned about tuple, list, and dictionary. You have to truly understand the topics before continuing to nex...
  • Contact Me On
    Contact Me on : e-mail : joni67676@gmail.com Facebook : John Twitter : @simplechilds Google + : Jhon Gu...
  • Creating Tuple, List, and Dictionary on Python Programming Language
    We have learned about Creating Function on Python Programming Language on my writing before. Now, we have to know how to collect a sequenc...
  • Definition and Function of Control Unit
    Definition and Function of Control Unit | pemprograman | komputer | bahasa python Control unit control CPU opera...

Label Cloud

  • Blog Tutorial
  • Komputer
  • Python Programming Language
  • Tips Trick

Blog

  • ▼  2014 (15)
    • November 2014 (1)
    • October 2014 (1)
    • September 2014 (3)
    • August 2014 (3)
    • July 2014 (7)

Followers

Mengenai Saya

Joni
View my complete profile
Back to top!
Copyright 2013 Computer Learning - All Rights Reserved Design by Mas Sugeng - Powered by Blogger