Python base point record 1

Source: Internet
Author: User

1 Variable: A variable is a word, only a single value

1 python data types interage, floats, booleans, string, etc.

2 Python is a case-sensitive language

3 python variables can be overwritten at any time

2 Pyt h on multiline comment is through "" "" * * * * """ "To achieve the 3 Pyth o n There are 6 kinds of arithmetic operators   +,-, *,/,** ( power ),% 4 Python inside x^m, written x**m 5 a String is passed   '   ' or ' "   wrapped in a string 6 Python is through   \   to implement the escape character. 7 We can use   ""   to avoid the appearance of escaped characters

  Set the variable fifth_letter to the fifth character of Monty

Fifth_letter = "MONTY" [4]

Print Fifth_letter

8 describes the first method of string,len () to find the length of the string

Parrot = "Norwegian Blue"

Print Len (Parrot)

9 describes the second method of String , Lower () converts all uppercase letters to lowercase letters

Parrot = "Norwegian Blue"

Print Parrot.lower ()

1 0 describes the third method of String , Upper () puts all the Small write letters into Big Write Letters

   convert lowercase letters in parrot to uppercase and print

Parrot = "Norwegian Blue"

Print Parrot.upper ()

One You can use + to connect two strings 1 2 Introduction str () converts a number to a string

Set a variable pi value to 3.14 to convert pi to string

PI = 3.14

Print str (PI)

Print "The value of pi is around" + str (3.14)

Python base point record 1

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.