How to write the square of x in python

藏色散人
Release: 2019-08-01 15:49:09
Original
61848 people have browsed it

How to write the square of x in python

How to write the square of x in python?

Python’s square operator is **, so the square of x in python is written like this: x**2.

For example:

Assume variables: a=10, b=20:

Then a**b is 10 raised to the 20th power, and the output result is 100000000000000000000

Note:

The Python language supports the following types of operators:

Arithmetic operators

Comparison (relational) operators

Assignment operator

Logical operator

Bit operator

Member operator

Identity operator

Operator precedence Level

Related recommendations: "Python Tutorial"

The above is the detailed content of How to write the square of x in python. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!