:Import Matplotlib.pyplot as PltImport NumPy as NPx = Np.linspace (-100,100,100)y = x**3Plt.figure (num=3,figsize= (8,5)) #num xuhao;figsize long widthL1=plt.plot (x, Y, ' P ') # Quta is-to-return name to Plt.legend (handles)Plt.xlim ((-100,100))Plt.
1 Environment Introduction:System Environment: WIN10Python environment: Python 3.6.0Pythonide:pycharm2 Output Hello WorldFirst create a Python file named Day1, and enter the code The code is as followsPrint ("Hello World") 3 debugging code with the
Good programming habits 2.1 in the program is with rich comments, comments help other programmers understand the program, help the program debugging (Find and eliminate errors in the program), and list useful information. When you modify or update
First, HelloWorld#! /usr/bin/env python#-*-Coding:utf-8-*-Print ("helloworld!")Second, user interaction#!/usr/bin/env python#_*_coding:utf-8_*_ name = input("What is your name?")print("Hello " name )When entering a password, if you want to be
higher-order functions: variables can directly think of functions, and directly to this variable execution function can receive functions to do parameters,It has the following characteristics: variables can point to functions, function parameters
July
With Django the realization of a more practical 博客系统 , make writing easier and more enjoyable.
Demo
Blog related pages
Blog Home
Blog details
Background Management related pages
Background Home
Add an
This article describes the differences between%r and%s in Python
%r is an object processed by the Rper () method
%s is an object processed by the STR () method
In fact, in some cases, the result of both processing is the same, for example, the
This article focuses on the method of moving the directory structure in Python, the need for friends can refer to the following
#Moving up/down dir structureprint os.listdir ('. ') # current Levelprint os.listdir (' ... ') # One level Upprint Os.
Summarizes 5 ways to concatenate a Python string:
1. Plus
First, people with programming experience know that many languages use a plus sign to connect two strings, and Python also uses "+" directly to connect two strings;
print ' Python ' + ' Tab '
Objective
Before you distinguish between the IS and = = operators, the first thing to know about the three basic features of objects in Python is the ID (identity), Python type () (data type), and value. IS and = = are the object of comparative
This article mainly introduced the Python module string.py detailed description of the relevant information, the article introduced in very detailed, for everyone has a certain reference value, the need for friends below to see it together.
First,
Linux basic commands1. How do I log in with the root account?Following the usual method of installing the operating system is the default with a normal user login system, this time only through the "sudo passwd root" command to set the root account
Recently learning python, Learn to control the process to write a guess number Game. Do not think of a child three-color Taiwan's a variety show, There is also a guessing number game, so I want to write a simple to play with their own.Rule: [0-100]
Python development [data structure]: basic, python Development Data StructureData Structure
What is a data structure?
Simply put, the data structure is to design the way in which data is organized and stored in the computer.
For example, lists, sets,
Regular Expression, Regular Expression
Import res = '3456fpeiuha123 @ 126.com '# match ret = re from the beginning. match ('34', s) print (ret) # Find the first ret = re. search ('56', s) print (ret) # Replace ret = re. sub ('@', '|', s) print (ret)
Exercise-binary search and exercise Binary Search
# Search in an ordered sequence and determine whether the value is greater than or less than the intermediate value. subtract half of each search until the exit condition is reached. # recursive
Python executeplugin, pythonexecuteplugin
When using executeplugin to insert data in batches, note the following:
1 # coding: utf8 2 3 conn = MySQLdb. connect (host = "localhost", user = "root", passwd = "123456", db = "myDB") 4 cursor = conn.
Python connection and memcache operation method, pythonmemcache
1. Open the memcached service.
Memcached-m 10-p 12000
2. Use the python-memcached module for simple links and data access
Import memcache mc = memcache. client (['2014. 127. 0.0.1: 1
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