I,Integer
1.
Relationship between digit size and bit
. Bit_length # How do I query the digits?
Conversion between boolean values (bool) and numbers
True False
N = bool (6)
Output True? # Can numbers and boolean values be converted to each other?
INT
[3] Just learned some simple exercises for Python and several exercises for pythonPython dating entertainment club: 613176398
(1) name = "aleX leNb"
1) Remove the spaces on both sides of the value corresponding to the name variable and output
Uppercase and lowercase conversions1 __author__="Kuankuan"2 Print("name is Jankinyu". Capitalize ())#Convert to first letter capitalization3 Print("name is Jankinyu". Title ())#To title Form Name is Jankinyu4 Print("NAMW". Lower ())#Convert to
Python learning path 3: python learning pathContent of this section:
Common string processing.
Format the output string.
String replacement.
Conversion of strings and binary data.
Dictionary operations
String operation
Common string
Python learning day3 ------ list, tuples, pythonday3 ------
I. List
Add brackets [] After the variable name. Next we will introduce how to query the list.
1 #! /Usr/bin/env python 2 #-*-Coding: UTF-8-*-3 # Author: Eric. shen 4 5 test = [] # name of
Here is a list of features of the following table: [A:B], starting from subscript A, to subscript (b-1) Element # name = [0,1,2,3,4,5,6,7,8,9]# print (Name[1:6]) # # result # [1, 2, 3, 4, 5]# name = [ 0,1,2,3,4,5,6,7,8,9]# print (name[3:]) # #
Python learning day3 -- python basics, pythonday3 -- python
1. python does not need to declare the type of the variable. python judges it at runtime.
2. Try not to splice strings with "+". during runtime, a memory space will be opened up for each "+"
Global variables, variables that can be called globallyLocal variables, variables that can be called in a subroutine' W ' def text (): ' L ' Print (name) text () print (name)Global variables are called and can be re-assigned, and cannot be
Listing (list)is one of the most commonly used data structures in Python and other languages. Python uses brackets [] to parse the list. The list is mutable (mutable)--You can change the contents of the list.Corresponding operation:1, check ([]
Python-week2, week 2 (based on Python3.0 or above ),1, list
We can use variables to store data, but when there are a lot of data, there will be many limitations when using variables, so the list is used at this time. The list is separated by commas (
Swift uses an automatic reference count (ARC (Automatic Reference count)) to manage the memory usage of the application. This means that memory management is already part of Swift, and in most cases you do not need to consider memory management.
1 #list:2name = ["LC","PXM","PT"]3 Print('------------', Name[2],"----------")4 5 #list slices6 Print(Name[1:3])#slices7 Print(Name[:3])8 Print(Name[-1])#take the last one .9 Print(name[-2:])#take the last two digitsTen One #List Additions
Tag: Width bit identifies SDE SLA intersect end Kanji parameterI. Basic data type 1. StringClass: StrMethod: Select str, hold command (CTRL) + Left button to jump to the corresponding method
Create
A = "hexin" a = str (' hexin ')
First, namespace and scope1. NamespacesWhere the name is stored, there are three types of namespaces (previously left x=1,1 stored in memory, where does the name x reside?). Namespaces are where the name X and 1 bindings are stored)2. Loading order
Python list operation--Increase
Append: Append a piece of data to the end of the list
name = ["Zhangsan", "Xiongda", "Lisi"]name.append ("Wangwu") Print name output: [' Zhangsan ', ' Xiongda ', ' Lisi ', ' Wangwu ']
Insert : Inserts a single piece
Basic data types in detail one, str string1.capitalize string first letter capitalization Does not change itself, it generates a new value1 name = ' Zhangsan ' 2 new_name = name.capitalize () 3 print (name) 4 print (new_name) 5 6 output: 7 zhangsan8
Python data type-string common operations, python Data Type
This section describes common string operations and examples.
1. python string
There are three methods to declare a string in python: adding single quotation marks, double quotation marks,
Python Data Type _ string Common Operations (detailed description), python Data Type
This section describes common string operations and examples.
1. python string
There are three methods to declare a string in python: adding single quotation marks,
Global variables: At the time of definition, a variable that is written by the head, without any indentation, is a global variable.Features of global variables: can be invoked anywhere in the current fileLocal variables: Variables defined in
Memory Management Basics *********************Memory management: For the management of the memory footprint of the instance (placed inside the heap)Example: 1: Instance constructed by class type, 2: Closure objectMemory management technology:
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.