Python Full Stack road DAY12

Source: Internet
Author: User

first edited September 29, 2017 9:15:21

Summary
I. Character encoding
Two. Data type
Three. Process Control
Homework
Summary today

Summary

References: Alex

    1. Character encoding
    2. String, List of additions and deletions to search
    3. For, while Loop
I. Character encoding
    1. ASCII code
      • 1 bits is the smallest representation unit in a computer 8bits = 1Byte = 1 bytes 1 bytes is the smallest storage unit in a computer
      • ASCII 8 bits per character
    2. Unicode
Two. Data type
    1. Str
      int shaping
      Long integer type
      List
      Dict
      Set
      float Float Type
    2. Multi-line comments
    3. Single and double quotes do not have any difference, they only apply to single-line. 3 single or double quotation marks for multiple lines of string or multiline comments
    4. Boolean type
      • True
      • False
    5. String

      • String Common functions:
        Remove white space: strip () You can take off the string and specify a space or symbol
        Split: Split () splits a string into a list by a specified symbol or space
        Length: Len () measure the length of the string
        Index: Index (NUM)
        Slices: [num1:num2] cut out from NUM1 to num2
        Step:
      • Gu Tou regardless of the tail
    • List
      Change and delete
      Append (-1) added to the last

Three. Process Control
    1. For...else

    1. While...else
Homework
    1. Job 2
      Shopping Cart Procedure
      Python shopping.py
      Input your salary:5000
      You can buy the following things:

      1. iphone 5800
      2. Coffee 30
      3. Book 50
      4. Condom 90
        1
        Can't afford to print, how much is the difference?
        2
        Put in the shopping cart, deduct the money while printing the balance ... 4970
        3
        4
        Q
        You bought the following things
        Coffee 30
        Book.. 333
        How many first 3000 do you have?
        Bye.
        Knowledge points
        1 cycles
        2 List
Summary today

Python Full Stack road DAY12

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.