-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlists2.py
More file actions
59 lines (43 loc) · 1.24 KB
/
Copy pathlists2.py
File metadata and controls
59 lines (43 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import random
wait_time=random.randint(1,60)
print(wait_time)
#mutable -list
#inmutable -tuple cannot be change under any circumstance.Tuple use as a constant list.
#dictionary - an unordered data structure (unordered and mutable). A dictonary stores key /values pairs.
temps=[32.0,212.0,0.0,81.6,95,4]
words=['hello','python']
print(words)
car_details=['opel','corsa','black','1.6','10200']
everything=[temps,words,car_details]
print(everything)
odds_and_ends=[[1,3,5,7],['a','b','c',],['one','two','three']] #lists inside of a list
print(odds_and_ends)
vowels=['a','e','i','o','u']
word="Milliways"
for letter in word:
if letter in vowels:
print(letter)
found=[]
print(len(found))
found.append('a')
found.append('e')
found.append('i')
found.append('o')
if 'u' not in found:
found.append('u')
print(found)
vowels=['a','e','i','o','u']
word=input("Provide a word to search for vowels: ")
found=[]
for letter in word:
if letter in vowels:
if letter not in found:
found.append(letter)
for vowel in found:
print(vowel)
#remove
nums=[1,2,3,4,5,9,7,8]
nums.remove(3) #this is not index value,ıt is value to remove
print(nums)
nums.pop() #to remove last item in list
print(nums)