-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTask05.py
More file actions
76 lines (59 loc) · 1.91 KB
/
Task05.py
File metadata and controls
76 lines (59 loc) · 1.91 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# Section 1
sample=[]
for i in range(1000):
sample.append(i)
answer=filter(lambda x: x%3!=0 and x%7==0, sample)
print(list(answer))
# Section 2
sample=[]
for i in range(50):
sample.append(i)
def multiply(x):
return x*x
answer=map(multiply,sample)
print(list(answer))
# Section 3
print("enter any string with combination of uppercase and lowercase characters")
sample=input()
answer=[i for i in sample if i.isupper()]
print(answer)
# Section 4
student = ['Smit', 'Jaya', 'Rayyan']
subject = ['CSE', 'Networking', 'Operating System']
zipped=zip(student,subject)
zipped=dict(zipped)
print(zipped)
# Section 5
'''
Generator: A generator-function is defined like a normal function,
but whenever it needs to generate a value, it does so with the yield keyword rather than return.
If the body of a def contains yield, the function automatically becomes a generator function.
next: Retrieve the next item from the iterator by calling its __next__() method.
If default is given, it is returned if the iterator is exhausted, otherwise StopIteration is raised.
yield: Yield can produce a sequence of values. yield should be used when we want to iterate over a sequence,
but don’t want to store the entire sequence in memory.
'''
# Section 6
s_input="Consultadd Training"
output=(print (i) for i in s_input[::-1])
next(output)
# Section 7
def f():
def g():
print("Hi, it's me 'g'")
print("Thanks for calling me")
print("This is the function 'f'")
print("I am calling 'g' now:")
g()
f()
# Section 8
'''
Front end technology deals with setting up the UI elements along with the functionality of a website.
All the interaction that a user has with the website is set up by a frontend developer.
Top 5 frontend technologies and their applications in companies:
a) ReactJS used by Airbnb
b) Angular used by Netflix
c) AJAX used by Flickr
d) CSS used by Google
e) XML used by Amazon
'''