The second part of Python

What data type?
int 1, 2, 3 Operational
float 1.2

str It is used to store certain information.

list =[1,2 ,3 ""Yes" is used to store large amounts of information.
touple(1,2, 3,) Used to store invariant lists, which can only be read.

dic ={"I: "Jin Liao Yuan" "you": "Beijing"} used to store data relations, easy to find.
set = {1, 2, 3, 4} Set the difference set, union and intersection of sets.


#Capitalization of strings
#String manipulation

# s = 'alexWusir'
# # s1 = s.capitalize()
# # print(s1)
#
# #Uppercase, lowercase
# s2 = s.upper()
# s3 = s.lower()
#
# print(s2, s3)

# s_str = 'acEQ'
#
# your_input = input("Please enter the verification code, not case sensitive: ""
#
# if s_str.lower()== your_input.lower():
# print("Input successful ""
# else:
# print("Please re-enter ""

#Case reversal
# s = "Alex Wusir"
#
# s3 = s.swapcase()
# print(s3)
#The first letter of each separated word is capitalized.
# s = "alex wusir"
# s4 = s.title()
# print(s4)
#Middle
# s = "alexWusir"
#
# s5 = s.center(20,'*')
# print(s5)

#Public approach
# s = "alexTwo high "
#
# l = len(s)
# print(l)

#What is the beginning?
# s = "alexyouaresogood"
# s7 =s.startswith("alex")
# s7 =s.startswith("ex", 2,3)
# print(s7)
#find Index can not be found and return to -1
#indexIndexing is not found by element.
# s = "alexWusWir"
# s8 = s.index("A")
# print(s8, type(s8))
#rstripDelete from the right, and lstrip will be deleted from the left.
# s = "*** Alex wusir %%%"
# s9= s.strip("*% ")
# print(s9)

# s = "alexaa wusrila"
# s10 = s.count("a")
#
# print(s10)


#split Splitting strings into lists
#
# s = "alexl wusir;lambaba"
# l = s.split("a")
#
# print(l)
#
# s = "My name is {name}, this year is {age}, hobby {hobby}, and I'm {name}". format (name =" too white ", age = 23, hobby =" girl ")
# print(s)


# s = "To look at the neighborhood neighbourhood.
# s10 = s.replace("Neighbour "," Lao Wang ", 1
# print(s10)

s = "siidjaijdlakdla"

# for i in s:
# print(i)

s = "fadacandadjikSora Aoi ksdalks "

# if "Sora Aoi "not in s:"
# print("Your comments are sensitive.

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


li = [1,'a','b',2,3,'a']
# li.insert(0,55) #Increase by index
# print(li)

# li.append('aaa') #Increase to the end
# li.append([1,2,3]) #Increase to the end
# print(li)

# li.extend(['q,a,w']) #Iterative increase
# 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)

#correction
lst = [1, 2, 3, 4, 3]

# lst[1] = "asbd"
# print(lst)
# lst[1:3] = ['a', 'b']
# print(lst)
# a = [1,2,3 ,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)

Leave a Reply

Your email address will not be published. Required fields are marked *