The second part of Python

Source: Internet
Author: User

What data type?
int 1, 2, 3 is used to operate the
FLOAT 1.2

STR is used to store certain information "" '

List =[1,2, 3 "yes", is] used to store a large amount of information
Touple (1, 2, 3,) is used to store immutable lists, read-only

DiC ={"I": "Jin Yuanyuan" "You": "Beijing" is used to store data relationships for easy search
Set = {1, 2, 3, 4} to find the set of differences, set, intersection


#字符串的大写
#字符串的操作

# s = ' Alexwusir '
# # S1 = s.capitalize ()
# # print (S1)
#
# #大写, lowercase
# s2 = S.upper ()
# s3 = S.lower ()
#
# Print (S2, S3)

# s_str = ' aceq '
#
# your_input = input ("Please enter a verification code, not case sensitive:")
#
# if s_str.lower () = = Your_input.lower ():
# Print ("Input succeeded")
# Else:
# print ("Please re-enter")

#大小写翻转
# s = "Alex Wusir"
#
# s3 = S.swapcase ()
# Print (S3)
#每个隔开的单词首字母大写
# s = "Alex Wusir"
# S4 = S.title ()
# Print (S4)
#居中
# s = "Alexwusir"
#
# S5 = S.center (20, ' * ')
# Print (S5)

#公共办法
# s = "Alex two High"
#
# L = Len (s)
# print (L)

#以什么开头
# s = "Alexyouaresogood"
# s7 =s.startswith ("Alex")
# s7 =s.startswith ("Ex", 2,3)
# Print (S7)
#find can be indexed, cannot find return-1
#index通过元素找索引, I can't find an error.
# s = "Alexwuswir"
# S8 = S.index ("A")
# Print (S8, type (s8))
#rstrip从右边开始删除, Lstrip Delete from the left
# s = "* * * Alex wusir%%%"
# s9= S.strip ("*%")
# Print (S9)

# s = "Alexaa Wusrila"
# s10 = S.count ("a")
#
# Print (S10)


#split splitting a string into a list
#
# s = "Alexl Wusir;lambaba"
# L = S.split ("a")
#
# print (L)
#
# s = "My Name {name}, this year is {age}, hobby {Hobb}, say again my name {name}". Format (name= "Taibai", age=23,hobb= "Girl")
# print (s)


# s = "To see things in the neighborhood"
# s10 = S.replace ("Neighborhood", "Lao Wang", 1)
# Print (S10)

s = "Siidjaijdlakdla"

# for I in S:
# Print (i)

s = "Fadacandadjik Cang jing Empty ksdalks"

# if "Cang jing empty" not in S:
# print ("Your comments have sensitive words")

# s = "123e2"
# Print (float (s))


Li = [1, ' A ', ' B ', 2,3, ' a ']
# Li.insert (0,55) #按照索引去增加
# Print (LI)

# li.append (' aaa ') #增加到最后
# li.append ([i]) #增加到最后
# Print (LI)

# li.extend ([' q,a,w ']) #迭代的去增
# li.extend ([' q,a,w ', ' aaa '])
# li.extend (' a ')
# li.extend (' abc ')
# li.extend (' A,b,c ')
# Print (LI)
#
# li.extend ([' q,a,w '])
# li.extend (' Qwa ')
# Print (LI)

Li = [1, 2, 3, 4]

# L1 = Li.pop (1)
# print (L1)

# del Li[1:3]
# Print (LI)

# Li.remove (2)
# Print (LI)

# li.clear ()
# Print (LI)

#改正
LST = [1, 2, 3, 4, 3]

# Lst[1] = "ASBD"
# Print (LST)
# Lst[1:3] = [' A ', ' B ']
# Print (LST)
# a = [45,3,3]
# # Print (A.count (3))
# Print (A.index (3))

A = [1,3,43,45,2,123,34,34]

# s10 = A[5:0:-1]
S10 = a[-1::-1]
Print (S10)
# A.sort (Reve
# rse=true)
# Print (a)
# A.reverse ()
# Print (a)

The second part of Python

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.