Python user interaction

Source: Internet
Author: User

Here comes a user interaction and judges the user to output names and get different responses.

Displays the name with a color.


#coding: Utf-8name = raw_input (' What is your name?: ') age = raw_input (' How  old are you?: ') job = raw_input (' What is your job?: ') msg =  " "INFORMATION OF %S AS BELOW:        NAME :  \033[42;1m%s \033[0m        Age  : %s         job  : %s "" " % (Name,name,age,job) If int (age )  >= 50:        print  "you are too  Old,you can only work "elif int  (age)  >=30:         print  "You are too old, you can only work for &NBSP elif int  (age)  >20:        print   wei cheng  Nian "else:        print " Old your xia "print msg 


Explain, in fact there is nothing to say, very simple, not to mention.

This article from the "Clear Sky" blog, declined reprint!

Python user interaction

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.