Python in Raw_input () and input ()

Source: Internet
Author: User
raw_input ([prompt]) input ([prompt]) # prompt: If the parameter is present, output directly to the screen, no further line

Raw_input returns the string form of the input character, as its literal meaning does, without any transformation operations

Input is essentially implemented using raw_input (), which calls the Eval () function after Raw_input () is called, and is called as follows:

def input (Prompt):     return (eval (raw_input (prompt)))

eg. Enter a pure numeric string, return a numeric type, and perform an operation on a valid Python numeric expression, returning the result of the operation ....

PS: In python3.x, the Raw_input () has been removed, instead of input (), which is only renamed, and the usage is the same. So here is the introduction of raw_input () and input () in python2.x, as long as the Raw_input () is used in python3.x.

Python in Raw_input () and input ()

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.