Learn Liaoche's Python tutorial and find a problem in the loop after class exercises.name = ['micheal','bob','jack' ] for in name: print(name)print (name) Print (Name[0])The result of the above code runWhat happens to two name,python in this
#encoding =utf-8"""Module:1, import demo# all the functions under the demo.py, call method: Demo.function ()2. Import function () function from demo import function () #从demo. py file#调用用法: Function ()3. From demo import all# if all is set under
Print statementThe print statement can output the specified text to the screen. For example, the output of ' Hello, world ', implemented in code as follows:>>> print ' Hello, world 'Attention:1. When we write code in a python interactive environment,
#-*-coding:utf-8-*-# Get user input first_num = raw_input (' Plesea your first num: ') # Print user First numprint "Your first num is%r . "% first_num# get user input second_num = raw_input (' Plesea your second num: ') # Print user Second Numprint"
Data typeA computer is a machine that can do mathematical calculations as the name implies, so a computer program can handle a variety of values. However, the computer can handle far more than the numerical value, but also can deal with text,
Understanding of strip () functions in python1. strip () function
Function prototypeDeclaration: "s" is a string and "rm" is the sequence of characters to be deleted.S. strip (rm): Delete the characters starting and ending in the s string and
Python Implementation of converting strings into numbersPython Implementation of converting strings into numbers
Python implementation that converts a string to a number, for example, converting a string "1234567.8" to 1234567.8
This is also
Flask --- another lightweight Web framework of Python
Flask is another lightweight Web framework in Python. on github, there are close to 15000 star. github addresses: FlaskIts usage is very similar to that of Bottle. If you are interested, refer
Start the first Django project and start the django Project
Once python, django, and (optional) databases and related libraries are installed, you can create a project to take the first step in developing django applications.
A project is a
Introduction to various databases compatible with the Python Django framework, pythondjango
Use PostgreSQL in Django
To use PostgreSQL, You need to download the psycopg development kit from the http://www.djangoproject.com/r/python-pgsql. We
Create the first static view in Django, django View
As our first goal is to create a webpage to output this famous example:
Hello world.
If you have published a Hello World page, but you have never used a webpage frame, simply enter Hello World
Create a dynamic view in Django.
In our ''current_datetime ''view example, although the content is dynamic, the URL (/time/) is static. In most dynamic web applications, URLs usually contain related parameters. For example, an online bookstore
Use of the if label in the Django framework of Python, pythondjango
{% If %} Label check (evaluate) a variable, if this variable is true (that is, the variable exists, not empty, not Boolean false ), the system displays any content between {% if %}
Python method for getting element quotation marks in array, python Index Number
This example describes how to obtain elements in an array by using python using quotation marks. Share it with you for your reference. The details are as follows:
Python implements the method of searching for sub-strings in strings, and searching in python
This example describes how to find a substring in a string using python. Share it with you for your reference. The details are as follows:
Here, python
The method by which the python string is centered.
This article describes how to center a python string. Share it with you for your reference. The details are as follows:
The following code centers the string, alignment left and alignment right.
Python calculates the average value of a sequence, and python calculates the average value.
This example describes how to calculate the average value of a sequence in python. Share it with you for your reference. The details are as follows:
Def
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