Python Script Instance 001

Source: Internet
Author: User
Tags python script

Summary of key points:

    • Input/output method, input (), print () method
    • List is an ordered collection of elements that can be added and removed at any time.
    • Conditional Statement If-else Application
#! /usr/bin/Pythonname= Input ('Please enter your name:') Address= Input ('Please enter your address:') Gender= Input ('Please enter your gender:') Info=[Name, address, gender]info_len=len (info) print ('\ n------------------------------------------------------------------\ n') Print ('you have entered', Info_len,'information, respectively:') Print ('Name:', info[0]) print ('Address:', info[1]) print ('Gender:', info[2]) print ('\ n------------------------------------------------------------------\ n') age_conf= Input ('is it convenient for you to tell us your bank deposit (y/n)?') Age_unicode=Ord (age_conf)ifAge_unicode = =121or Age_unicode = = the: Money=int(Input ('So, how much do you have in your bank account? ')) Info.append (money)ifMoney >=10000: Print ('\ n Respect.', info[0],'Hello, your personal information is:', info) print ('in view of your so rich, in order to prevent the thief to stare, quickly delete some of your information it \ n') Delno= Input ('Delete name Please press 0, delete address please press 1, delete sex Please press 2, delete deposit please press 3\n Please select:') Del_int=int(delno) print ('you want to delete the', Info[del_int]) cont= Input ('Are you sure you want to delete it? (y/n)') Cont_unicode=Ord (cont)ifCont_unicode = =121or Cont_unicode = = the: Info.pop (del_int) print ('The information you have selected has been deleted! Now the remaining information is \ n', info)Else: Print (Info[del_int],'The information is not deleted and the current information is still', info)Else: Print ('just', Money,'Block Money ... Don't pull it off, just pay the rent, or you'll sleep on the street! ')Else: Print ('forget, don't tell pull to, with I have not half gross money relationship! ')

Python Script Instance 001

Related Article

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.