Skip to content

2627lesson #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions 24listinitital.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# List Initial
pptList = [20,30,40,50]
# print(pptList[3])
# print(pptList[-1],'reverse')

# slicing
# print(pptList[:])
# print(pptList[0:2])
# print(pptList[0:-1])
# print(pptList[0:])
19 changes: 19 additions & 0 deletions 25lesson.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
pptNames = ['pyae','phyo','thant']
# add new data
pptNames.append('Chinese')
# print('pptNames Updated',pptNames)

# rempve()
# toRemoveName = pptNames[3]
# toRemoveName = pptNames[-1]
# print('toRemoveName',toRemoveName)
# pptNames.remove(toRemoveName)
# print('removed a name',pptNames)

# pop()
# pptNames.pop(3)
# print(pptNames)

# del keyword
# del pptNames[3]
# print('used del keyword',pptNames)
61 changes: 61 additions & 0 deletions 26MaxMin27.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# MaxMin
numberList = [10,20,30,40,56,88,99,78,21]
# print(max(numberList))
# print(min(numberList))

# reverse
# numberList.reverse()
# print(numberList)

# index
# print(numberList.index(99))

# sum
# print(sum(numberList))

# sort
# numberList.sort()
# numberList.sort(reverse=True)
# print(numberList)
# sorting words

# nameList = ['asusVivoBookLaptop','vaselineLotion','royaldDrink','alpinePurifiedDrinkingWater']
# nameList.sort()
# nameList.sort(reverse=True)
# nameList.sort(key=len)
# nameList.sort(key=len,reverse=True)
# print(nameList)

# slicing and remove
# intejer_list = [1,2,3,6,5,4,9,7,8]

# for i in intejer_list[:3]:
# print('to remove element',i)
# intejer_list.remove(i)

# print(intejer_list)

# list play
# pptList = []
# for i in range(1,10):
# double_value = i**2
# print('double_value of {} is : '.format(i),double_value)
# pptList.append(double_value)
# print(pptList)
# # max value
# print(max(pptList))
# # smallest value
# print(min(pptList))
# # reverse value
# pptList.reverse()
# print('Reversed value of pptList is: ',pptList)

# # index value
# for i in pptList:
# index_value = pptList.index(i)
# print('index value of {}'.format(i),index_value)

# Tuple to list
tuple_list = (20,50,80)
print(list(tuple_list))