1. Operators and their usage
operator
name
Description
Example
+
Add
Two objects added
3 + 5 get 8. ' A ' + ' B ' gets ' ab '.
-
Reducing
Get negative numbers or one
PythonProgramEverything used is called an object. For every number, string, or even function as an object, python is an extremely completely forward object.
#! Learn moreI = 5Print II = I + 1
S = ''' this is a multi-line string.This is the
In python, there are no operators such as ++-=, & |! It can only be expressed by not and all, but there are + =-=... And so on.The following operations are based on the results of python3.3.Arithmetic operators>>> 17% 65>>> 17/62.8333333333333335>>>
First, for
Second, while
Third, do While
Iv. continue
V. Break
First, forPlease output 1000 * numbers on the screenprintf ("************************* ...");#include "stdio.h" void Main () { int i; for (i=1;ifor (expression
Python features (slightly, find a lot of online, but I think to use later to summarize his characteristics)First, the basic concept1. There are four types of Python: integers, long integers, floating-point numbers, complex numbersintegers, such as
Operators and expressionsMost of the statements you write (logical lines) contain expressions (Expressions). A simple example of an expression is 2+3 . An expression can be split into operators (Operators) and operands (operands).operators
One, OS module1.os.nameThe output string indicates the platform being used. If the window is ' NT ', it is ' POSIX ' for Linux/unix users.2.OS.GETCWD ()The function gets the current working directory, which is the directory path of the current
Python is an increasingly popular scripting language today, it is simpler than Java, more powerful than PHP, and also applicable to the development of desktop applications, in Ubuntu, is a necessary script engine, so it is necessary to learn, the
Reprint remember to tell Chin-Qian Oh ~
Sync Update: https://www.dreamwings.cn/lca/4874.html Overview
LCA (least Common ancestors), a recent public ancestor, refers to the problem of finding the nearest common ancestor of two nodes, U and V, in a
the characteristics of Python
1. Simple
Python is a language that represents simple ideas.
2. easy to learn
Python has an extremely simple syntax.
3. free, open source
Python is one of the floss (free/open source) software.
4. high-level
Brief introduction
Most of the statements you write (logical rows) contain an expression. A simple expression example is 2 + 3. An expression can be decomposed into operators and operands.
The function of an operator is to accomplish something
Python Base language annotations单行注释:#多行注释:‘‘‘ ‘‘‘ 或 """ """Digital整型(Int)- 通常被称为是整型或整数,是正或负整数,不带小数点。长整型(long integers)- 无限大小的整数,整数最后是一个大写或小写的L。bool(布尔型) true false浮点型(floating point real values)- 浮点型由整数部分与小数部分组成,浮点型也可以使用科学计数法表示(2.5e2 = 2.5 x 1
First we need to understand the content and format of the script
The first line must be shebang (interpreter path), shebang must occupy the absolute beginning
In the shell script, except for Shebang, the contents of the line beginning
Scripting: Stacking of commandsThe first line of any script:#!/bin/bash: The Interpreter pathIn addition to the previous # number as a commentExecute permission before script execution: chmod +x file nameCondition Judgment in bash:Condition Test
One, the logical operator of Python 1, numeric operators:
operator
Description
Example
+
Add-Two objects added
A + B output result 30
-
Minus-get negative numbers or one number
In the shell, the command execution succeeds with a return value of 0, and the unsuccessful return value is not 0Logic with:Shell 0 is true, not 0 is falseWhen the first condition is true, the second condition must be judged;When the first condition
Operators and conditional statementsArithmetic operators
operator
Description
Example
+
Add-Two objects added
A + B output result 30
-
Minus-get negative numbers or one number
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.