Python string, numeric calculation _python

Source: Internet
Author: User

Python is an object-oriented language, but it does not encapsulate standard classes into libraries like C + +, but is further encapsulated, and the language itself integrates classes and functions, such as print,list,dict etc. It's very convenient for programming.

Python uses # for single-line comments, using ' or ' ' to make multiline comments

Numerical calculation

>>> print "One Hour has", "seconds" one 
Hour has 3600
>>> result = 12 # Same line of code benefits Make formatting clearer with space
>>> print result
12


String

Python uses "or" to denote a string, accustomed to using a single word with the word ""

>>> print ' Here's is Python ' This is
python,to O

If you use a non-ASCII-encoded character in your text, you can join the #-*-coding:utf-8 on the Python script's open-*-

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.