Python Basics Day01 Exercises

1 string formatting1 #!/urs/bin/env python2 3Name = input ("Name:")4age = Int (input ("Age :"))5Job = input ("Job:")6Salary = input ("Salary:")7 8Info1 ="""9 Ten -----------Info1 of%s--------- One Name:%s A Age :%s - Job:%s - Salary:%s the """%(name,

Python Regular Expressions

1. The regular expression base 1.1. Simple IntroductionRegular expressions are not part of Python. Regular expressions are powerful tools for working with strings, with their own unique syntax and an independent processing engine, which may not be

Python-time Module

1. The timestamp is a floating-point fraction in seconds, and the timestamp is expressed as the time elapsed from Midnight January 1, 1970 to now.2. Time Module Introduction mode: Import times3. Return timestamp time.time ()4, return time tuple:

Python collects Centos7ip addresses

Python collects network card IP and MAC addresses via regular#!/usr/bin/env python# coding=utf-8 import refrom subprocess import popen,  pipe def getifconfig ():     p = popen ([' Ifconfig '], stdout= PIPE)     data = p.stdout.read (). Decode ().

Python intrinsic functions

The range function that is commonly used in loops, such asFor I in range (10)Print (i)The range here is a built-in function in Python.It has a parameter of Start_value,stop_value,step_valueRange (Start_value,stop_value,step_value)#start_value start

Sublime TEXT3 configuration to run Python shortcuts in an interactive environment

Installing pluginsIt feels good to write code under sublime Text3, but there are some problems when writing python.Open the Python file with sublime Text3, or write the Python code under sublime Text3, use the shortcut key ctrl+b to run, and the

Python Input Summary

Input summary in Python 21.raw_input (prompt = none) with input (prompt = none)Two are the default parameter types, which can be passed in a string that is used for input when output, such as1 # Well, your name is really a good movie . 2 your_name =

Python Learning (II.)--about class

1, no permission control, before the class method or variable with "__" two underscores, then become "private" variable (actually through the ___ can be accessed)2, the class of several automatic triggering of the built-in method: __new__

Python Learning Notes (lists, tuples, shopping cart instances)

First, ListLists and dictionaries are two of the most common data types1. Requirements: How to store the class more than 80 people's name, how to achieve?names = ["Zhangyang","Guyun","Xiangpeng","Xuliangchen"]Print(Names[0],names[2])#Remove

Python Learning Summary

Background: This article is similar to the catalogue part of the article, in order to systematically learn Python new knowledge and review summarySummary:Python basic syntaxNumPy LibraryMatplotlib Drawing LibraryPandas LibraryScikit-learn Machine

Tips for Python debug tips && engineering Capabilities

Debug Tips:Reprint please declare this article citation source: Look at Daniel's small fresh1. In the first programming, the else is written after each if, so that if your else is not supposed to run, then you can output the state information at

Python if __name__ = = ' __main__ ' What's hell is it?

Python if __name__ = = ' __main__ ' What's hell is it?Python believes that all modules can be executed or importIf a module is imported by import, the caller of the module may just want to use part of the module's code instead of running it

Python simulates removing whitespace on both sides of a string

Goal:1. Using the whitespace of the string module2. Delete left, right, and white space on both sidesThe code is as follows:[email protected] python]# cat rmspace.py#!/usr/bin/env python#Coding:utf8"""use a string to remove left and right whitespace.

1. Basic Python Concepts

1, the numberThere are 4 types of numbers in Python-integers, long integers, floating-point numbers, and complex numbers2. StringA sequence of characters enclosed in single, double, or triple quotation marks, such as:' Char ' # single quote

Referenced in Python

mutable types and immutable types in Python:Before we talk about Python-depth copies, we should first understand the types of elements in Python: they are mainly classified as mutable types and immutable types.A mutable type is two of the types of

HTTP request class based on Python third-party requests module

A Third-party library is installed first using the requests module-constructed Downloader requestsPIP Install requests1 classstrongdownload (object):2 3 def __init__(self):4 #Get Agent IPList .5Self.iplist = ['Find your own

Use the sort () method in Python.

Use the sort () method in Python. I. Basic Form sorted(iterable[, cmp[, key[, reverse]]])iterable.sort(cmp[, key[, reverse]]) Parameter description: (1) iterable specifies the list or iterable to be sorted. Needless to say; (2) cmp is a function

String, Character

String, CharacterPython string of the Initial Basic Data Type -- DaoxinTwo types of string formatting: String % s Number % d   Name = 'I am % s' % 'daoxin'>>> Name'I am daoxin'   >>> Name = 'I am % s, age % d' % ('daoxin', 13) >>> Name'I am daoxin,

Django servers call each other through remote users, djangoremote

Django servers call each other through remote users, djangoremote First, the scenario is as follows: There are two django web applications, and there is a certain relationship between the two applications. In some cases, each other needs to obtain

The path to python: wupeiqi

The path to python: wupeiqi 1. Install Python 2 and Python 3 in windows. Download Python2 and Python3Https://www.python.org/downloads/ Install two versions respectively Bytes Add Environment Variables After Python3 is installed, it is added to the

Total Pages: 4013 1 .... 3970 3971 3972 3973 3974 .... 4013 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.