Get the App
SLTechnology News&Howtos  ›  Development  › 

Python getting started basic point

Shulou Source: shulou.com Published: 2022-06-03 05:36:59 09月26日 Update

Today, I will talk to you about the basic points of getting started with python, which may not be well understood by many people. in order to make you understand better, the editor has summarized the following contents for you. I hope you can get something according to this article.

The python language is concise and easy to learn, and people with little programming experience can get started quickly and make a script with simple functions to help me get the job done. Let's take a look at what we know about how to get started with python, so that we can write shell scripts to accomplish our simple work requirements through python. [of course it is easier to learn and use than shell]

[python] view

Plaincopy

1. Basic input / output:

Someth = input ('Please input something:\ n') # # get standard input

Somethelse = raw_input ('please input some other thing:\ N')

Print someth, # output does not wrap

Print someth # output and line feeds

Print's your input is% other thing% s'% (someth, somethelse) # formatted output

2. Basic types and assignments:

Bool = True/False

Int = 1

Lang = 1L

Float = 0.1

Cpm = 1 + 2J

Str = 'string'

Tuple = (1, 2)

List = [1BI 2]

Dict = {1VAR 1pm 2RO 2}

Null = None

3. Basic operator:

A > b

A < b

A = b

A! = b

A b

A 2 # @ moves 2 bits to the left, which is equal to multiplying by 4

A

Tags: Type help content parameter object output input function character string data file method support foundation thing function name attribute easy to learn Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information vpn Apple macOS Redmi