Python study Note 1: Basic knowledge

Source: Internet
Author: User

Python can process very large integers: [python] 1000000000000000000L common integers cannot be greater than 2 147 483 647 147 (nor smaller than-2 483 648, you can use the same method as a normal integer to write a long integer, but there is an L variable [python] x = 3 x * 2 at The end, and The result is 6 to get The user input [python] input ("The meaning of life :") function 1, pow (2, 3) 2 to the power of 3, calculate the absolute value of multiplication 2, abs (-10) 3, round (1.0/2.0) the floating point number is rounded to the nearest integer module [python] import math. the floor (32.9) 32.0 floor function is in the math module as follows: module. if the function is converted to an integer, the new int function abs (number) can be used to return the absolute value of the number cmath. sqrt (number) returns the square root. It can also be applied to a negative float (object) to convert strings and arrays to floating point help () for interactive help www.2cto. cominput (name) get user input int (object) convert string and number to long integer long (object) convert string and number to long integer number math. ceil (number) returns the upper integer of the number. the return value type is floating point math. floor (number) returns the number of rounded down integers. the return value type is floating point math. sqrt (number) returns the square root, which is not applicable to negative pow (x, y [, z]) returns Y of X (the resulting result is modulo Z) raw_input (prompt) returns the string representation of the string repr (object) returned value. round (number [, ndigits]) rounds the number to str (object) based on the given precision) convert a value to a string

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.