Monday 15 February 2021

13 Feb 2021 MultiMedia Test Result

 13 Feb 2021 MultiMedia Test Result


S.No.

Name

Marks

1

Suruchi

43

2

Salvi Vatsa

41

3

Gaurav

36

4

Yamini

36

5

Vibhakar

35

6

Rakesh

34

7

Meerayadav

34

8

Ankur Bhardwaj

33

9

Priyanka Arora

33

10

Annu

32

11

Kirti

32

12

Kulshum

30

13

Deepti

30

14

Bhavna

29

15

Venuka Khanna

29

16

Pooja Rana

29

17

Geetika

29

18

Sunaina Bizenia

28

19

Lovely

27

20

Harshita

26

21

Bharti Goel

26

22

Sandeep

25

23

Pritam Kumari

24

24

Vijay Kushawah

24

25

Rohit

24

26

Alka Sharma

23

27

Mittu

23

28

Rekha

23

29

Renu Gahlot

23

30

Vikram Sharma

23

31

Ambika Sharma

23

32

Yogesh

22

33

Shashi Bhushan

22

34

Nisha

21

35

Charu

21

36

Nancy Aggrawal

21

37

Kalyani

20

38

Sonika

20

39

Priya Chaurasia

20

40

Jyoti Sharma

20

41

Priyanka Soni

19

42

Rajesh

19

43

Puneet Dabas

19

44

Anushka

19

45

Sandhya

18

46

Vikas Patel

18

47

Preet Kaur

18

48

Sony Jha

18

49

Anupam Singh

18

50

Jaya Rathore

18

51

Shefali Mavi

18

52

Devansh Maurya

18

53

Surbhi

15

54

Swati

15

55

Kaushal

14

56

Neha Gupta

14

57

Pratibha

14

58

Prabhjot Kaur

13

59

Jatin Sharma

5

60

Ravi

5


Function and Module in Python

 '''

import math

print(math.sqrt(36))



import math as m

print(m.sqrt(36))


from math import *

print(sqrt(36))

print(pow(6,2))



from math import sqrt,log10,pi

print(sqrt(36))

print(log10(10))

print(pi)


import random

print(random.randrange(5))

print(random.randrange(10,16))


'''


def sum():

    print(5+6)


sum()


def sum(a,b):

    print(a+b)


sum(5,8)

k=sum(2,3)

print(k)

print(sum(9,6))




def prod(a,b):

    return a*b



print(prod(5,6))

k=prod(5,8)

print(k)








Python 3.8.5 (tags/v3.8.5:580fbb0, Jul 20 2020, 15:43:08) [MSC v.1926 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
>>> math.sqrt(25)
Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    math.sqrt(25)
NameError: name 'math' is not defined
>>> sqrt(25)
Traceback (most recent call last):
  File "<pyshell#1>", line 1, in <module>
    sqrt(25)
NameError: name 'sqrt' is not defined
>>> import math
>>> math.sqrt(25)
5.0
>>> math.pow(2,3)
8.0
>>> math.pow(3,0)
1.0
>>> math.pow(100,-2)
0.0001
>>> abs(-5)
5
>>> math.fabs(-5)
5.0
>>> math.fabs(5)
5.0
>>> math.ceil(3.2)
4
>>> math.ceil(3.9)
4
>>> math.floor(3.9)
3
>>> math.floor(3.2)
3
>>> math.cos(30)
0.15425144988758405
>>> math.sin(30)
-0.9880316240928618
>>> math.tan(30)
-6.405331196646276
>>> math.log10(100)
2.0
>>> print(help(math.cos))
Help on built-in function cos in module math:

cos(x, /)
    Return the cosine of x (measured in radians).

None
>>> print(help(bin))
Help on built-in function bin in module builtins:

bin(number, /)
    Return the binary representation of an integer.
    
    >>> bin(2796202)
    '0b1010101010101010101010'

None
>>> 
= RESTART: C:/Users/S P SHARMA/AppData/Local/Programs/Python/Python38-32/15feb1.py
Traceback (most recent call last):
  File "C:/Users/S P SHARMA/AppData/Local/Programs/Python/Python38-32/15feb1.py", line 2, in <module>
    print(sqrt(36))
NameError: name 'sqrt' is not defined
>>> 
= RESTART: C:/Users/S P SHARMA/AppData/Local/Programs/Python/Python38-32/15feb1.py
6.0
>>> 
= RESTART: C:/Users/S P SHARMA/AppData/Local/Programs/Python/Python38-32/15feb1.py
Traceback (most recent call last):
  File "C:/Users/S P SHARMA/AppData/Local/Programs/Python/Python38-32/15feb1.py", line 2, in <module>
    print(math.sqrt(36))
NameError: name 'math' is not defined
>>> 
= RESTART: C:/Users/S P SHARMA/AppData/Local/Programs/Python/Python38-32/15feb1.py
6.0
>>> 
= RESTART: C:/Users/S P SHARMA/AppData/Local/Programs/Python/Python38-32/15feb1.py
6.0
>>> 
= RESTART: C:/Users/S P SHARMA/AppData/Local/Programs/Python/Python38-32/15feb1.py
6.0
36.0
>>> 
= RESTART: C:/Users/S P SHARMA/AppData/Local/Programs/Python/Python38-32/15feb1.py
6.0
36
>>> 
= RESTART: C:/Users/S P SHARMA/AppData/Local/Programs/Python/Python38-32/15feb1.py
6.0
Traceback (most recent call last):
  File "C:/Users/S P SHARMA/AppData/Local/Programs/Python/Python38-32/15feb1.py", line 15, in <module>
    print(log10(10))
NameError: name 'log10' is not defined
>>> 
= RESTART: C:/Users/S P SHARMA/AppData/Local/Programs/Python/Python38-32/15feb1.py
6.0
1.0
>>> 
= RESTART: C:/Users/S P SHARMA/AppData/Local/Programs/Python/Python38-32/15feb1.py
6.0
1.0
Traceback (most recent call last):
  File "C:/Users/S P SHARMA/AppData/Local/Programs/Python/Python38-32/15feb1.py", line 16, in <module>
    print(pi)
NameError: name 'pi' is not defined
>>> 
= RESTART: C:/Users/S P SHARMA/AppData/Local/Programs/Python/Python38-32/15feb1.py
6.0
1.0
3.141592653589793
>>> sqrt(16)
4.0
>>> log10(10)
1.0
>>> from math import *
>>> 
= RESTART: C:/Users/S P SHARMA/AppData/Local/Programs/Python/Python38-32/15feb1.py
Traceback (most recent call last):
  File "C:/Users/S P SHARMA/AppData/Local/Programs/Python/Python38-32/15feb1.py", line 14, in <module>
    import math.sqrt
ModuleNotFoundError: No module named 'math.sqrt'; 'math' is not a package
>>> 
= RESTART: C:/Users/S P SHARMA/AppData/Local/Programs/Python/Python38-32/15feb1.py
6.0
1.0
3.141592653589793
Traceback (most recent call last):
  File "C:/Users/S P SHARMA/AppData/Local/Programs/Python/Python38-32/15feb1.py", line 19, in <module>
    print(random.randrange())
TypeError: randrange() missing 1 required positional argument: 'start'
>>> 
= RESTART: C:/Users/S P SHARMA/AppData/Local/Programs/Python/Python38-32/15feb1.py
6.0
1.0
3.141592653589793
0
>>> 
= RESTART: C:/Users/S P SHARMA/AppData/Local/Programs/Python/Python38-32/15feb1.py
6.0
1.0
3.141592653589793
1
>>> 
= RESTART: C:/Users/S P SHARMA/AppData/Local/Programs/Python/Python38-32/15feb1.py
6.0
1.0
3.141592653589793
0
>>> random.randrange(5)
2
>>> random.randrange(5)
3
>>> random.randrange(5)
2
>>> random.randrange(5)
0
>>> random.randrange(5)
0
>>> random.randrange(5)
1
>>> random.randrange(5,10)
8
>>> random.randrange(5,10)
6
>>> random.randrange(5,10)
9
>>> random.randrange(5,10)
5
>>> random.random()
0.8535010982692898
>>> random()
Traceback (most recent call last):
  File "<pyshell#34>", line 1, in <module>
    random()
TypeError: 'module' object is not callable
>>> from random import *
>>> random()
0.5113307022171122
>>> 
= RESTART: C:/Users/S P SHARMA/AppData/Local/Programs/Python/Python38-32/15feb1.py
2
10
>>> 
= RESTART: C:/Users/S P SHARMA/AppData/Local/Programs/Python/Python38-32/15feb1.py
0
14
>>> randrange(10,16)
Traceback (most recent call last):
  File "<pyshell#37>", line 1, in <module>
    randrange(10,16)
NameError: name 'randrange' is not defined
>>> from random import *
>>> randrange(10,16)
14
>>> randrange(10,16)
10
>>> random(10,16)
Traceback (most recent call last):
  File "<pyshell#41>", line 1, in <module>
    random(10,16)
TypeError: random() takes no arguments (2 given)
>>> randrange(10.0,16.0)
14
>>> randint(5,10)
9
>>> randint(5,10)
7
>>> randint(10)
Traceback (most recent call last):
  File "<pyshell#45>", line 1, in <module>
    randint(10)
TypeError: randint() missing 1 required positional argument: 'b'
>>> uniform(5,10)
5.833345307979021
>>> choice([5,8,2,9])
2
>>> L=[10,15,5,9]
>>> choice(L)
10
>>> choice(L)
15
>>> L=['Salvi','Poonam','Raj']
>>> choice(L)
'Salvi'
>>> choice(L)
'Poonam'
>>> L=(10,15,5,9)
>>> choice(L)
9
>>> 
= RESTART: C:/Users/S P SHARMA/AppData/Local/Programs/Python/Python38-32/15feb1.py
11
>>> 
= RESTART: C:/Users/S P SHARMA/AppData/Local/Programs/Python/Python38-32/15feb1.py
11
13
>>> 
= RESTART: C:/Users/S P SHARMA/AppData/Local/Programs/Python/Python38-32/15feb1.py
11
13
5
None
>>> 
= RESTART: C:/Users/S P SHARMA/AppData/Local/Programs/Python/Python38-32/15feb1.py
11
13
5
None
15
None
>>> 
= RESTART: C:/Users/S P SHARMA/AppData/Local/Programs/Python/Python38-32/15feb1.py
11
13
5
None
15
None
30
>>> 
= RESTART: C:/Users/S P SHARMA/AppData/Local/Programs/Python/Python38-32/15feb1.py
11
13
5
None
15
None
30
40
>>> 
= RESTART: C:/Users/S P SHARMA/AppData/Local/Programs/Python/Python38-32/15feb1.py
11
13
5
None
15
None
None
None
>>> 
= RESTART: C:/Users/S P SHARMA/AppData/Local/Programs/Python/Python38-32/15feb1.py
11
13
5
None
15
None
30
40
>>> 

Saturday 13 February 2021

Dictionary and Stack in Python

 

Python 3.8.5 (tags/v3.8.5:580fbb0, Jul 20 2020, 15:43:08) [MSC v.1926 32 bit (Intel)] on win32

Type "help", "copyright", "credits" or "license()" for more information.

>>> D={}

>>> D

{}

>>> type(D)

<class 'dict'>

>>> D1=dict()

>>> D1

{}

>>> type(D1)

<class 'dict'>

>>> D[1]="Ram"

>>> D

{1: 'Ram'}

>>> D[2]="Raj"

>>> D[5]="Sam"

>>> D["id"]=112

>>> D

{1: 'Ram', 2: 'Raj', 5: 'Sam', 'id': 112}

>>> D1={1:'Ram',2:'Raj'}

>>> D1

{1: 'Ram', 2: 'Raj'}

>>> D[5]

'Sam'

>>> D['id']

112

>>> D[4]

Traceback (most recent call last):

  File "<pyshell#16>", line 1, in <module>

    D[4]

KeyError: 4

>>> 

= RESTART: C:/Users/S P SHARMA/AppData/Local/Programs/Python/Python38-32/13feb.py

1

8

3

id

>>> 

= RESTART: C:/Users/S P SHARMA/AppData/Local/Programs/Python/Python38-32/13feb.py

Ram

Raj

Sam

122

>>> 

= RESTART: C:/Users/S P SHARMA/AppData/Local/Programs/Python/Python38-32/13feb.py

1 : Ram

8 : Raj

3 : Sam

id : 122

>>> 

= RESTART: C:/Users/S P SHARMA/AppData/Local/Programs/Python/Python38-32/13feb.py

{1: 'Ram', 8: 'Raj', 3: 'Sam', 'id': 122}

>>> a=1:"Ram"

SyntaxError: invalid syntax

>>> a=1

>>> a="Ram"

>>> 

= RESTART: C:/Users/S P SHARMA/AppData/Local/Programs/Python/Python38-32/13feb.py

{1: 'Ram', 8: 'Raj', 3: 'Sam', 'id': 122}

1 = Ram

8 = Raj

3 = Sam

id = 122

>>> 

= RESTART: C:/Users/S P SHARMA/AppData/Local/Programs/Python/Python38-32/13feb.py

1 = Ram

8 = Raj

3 = Sam

id = 122

{1: 'Ram', 8: 'Raj', 3: 'Sam', 'id': 122, 5: 'John'}

>>> 

= RESTART: C:/Users/S P SHARMA/AppData/Local/Programs/Python/Python38-32/13feb.py

1 = Ram

8 = Raj

3 = Sam

id = 122

{1: 'Ram', 8: 'Raj', 3: 'Sam', 'id': 122, 5: 'John'}

{1: 'Amit', 8: 'Raj', 3: 'Sam', 'id': 122, 5: 'John'}

>>> d1={1:10,2:20,3:30}

>>> d2={4:40,5:50}

>>> d1

{1: 10, 2: 20, 3: 30}

>>> d2

{4: 40, 5: 50}

>>> d1+d2

Traceback (most recent call last):

  File "<pyshell#24>", line 1, in <module>

    d1+d2

TypeError: unsupported operand type(s) for +: 'dict' and 'dict'

>>> d1.update(d2)

>>> d1

{1: 10, 2: 20, 3: 30, 4: 40, 5: 50}

>>> d2

{4: 40, 5: 50}

>>> d3={1:40,2:50,3:70}

>>> d1.update(d3)

>>> d1

{1: 40, 2: 50, 3: 70, 4: 40, 5: 50}

>>> del d1[3]

>>> d1

{1: 40, 2: 50, 4: 40, 5: 50}

>>> del d1

>>> d1

Traceback (most recent call last):

  File "<pyshell#34>", line 1, in <module>

    d1

NameError: name 'd1' is not defined

>>> d1={1: 40, 2: 50, 3: 70, 4: 40, 5: 50}

>>> d1

{1: 40, 2: 50, 3: 70, 4: 40, 5: 50}

>>> d1.pop(3)

70

>>> d1

{1: 40, 2: 50, 4: 40, 5: 50}

>>> 1 in d1

True

>>> 5 in d1

True

>>> 3 in d1

False

>>> 40 in d1

False

>>> 40 not in d1

True

>>> d1

{1: 40, 2: 50, 4: 40, 5: 50}

>>> len(d1)

4

>>> d.clear()

Traceback (most recent call last):

  File "<pyshell#46>", line 1, in <module>

    d.clear()

NameError: name 'd' is not defined

>>> d1.clear()

>>> d1

{}

>>> d1={1: 40, 2: 50, 3: 70, 4: 40, 5: 50}

>>> d1

{1: 40, 2: 50, 3: 70, 4: 40, 5: 50}

>>> d1[2]

50

>>> d1.get(2)

50

>>> d1[9]

Traceback (most recent call last):

  File "<pyshell#53>", line 1, in <module>

    d1[9]

KeyError: 9

>>> d1.get(9)

>>> d1.get(9,"This key is not available")

'This key is not available'

>>> d1.get(2,"This key is not available")

50

>>> print(d1.get(9))

None

>>> d1.items()

dict_items([(1, 40), (2, 50), (3, 70), (4, 40), (5, 50)])

>>> d1.keys()

dict_keys([1, 2, 3, 4, 5])

>>> d1.values()

dict_values([40, 50, 70, 40, 50])

>>> 

= RESTART: C:/Users/S P SHARMA/AppData/Local/Programs/Python/Python38-32/13feb.py

1 = Ram

8 = Raj

3 = Sam

id = 122

>>> 

= RESTART: C:/Users/S P SHARMA/AppData/Local/Programs/Python/Python38-32/13feb.py

1 = Ram

8 = Raj

3 = Sam

id = 122

>>> 

= RESTART: C:/Users/S P SHARMA/AppData/Local/Programs/Python/Python38-32/13feb.py

1

8

3

id

>>> 

= RESTART: C:/Users/S P SHARMA/AppData/Local/Programs/Python/Python38-32/13feb.py

Ram

Raj

Sam

122

>>> 

= RESTART: C:/Users/S P SHARMA/AppData/Local/Programs/Python/Python38-32/13feb.py

(1, 'Ram')

(8, 'Raj')

(3, 'Sam')

('id', 122)

>>> d1

Traceback (most recent call last):

  File "<pyshell#61>", line 1, in <module>

    d1

NameError: name 'd1' is not defined

>>> d1={1: 40, 2: 50, 3: 70, 4: 40, 5: 50}

>>> d1

{1: 40, 2: 50, 3: 70, 4: 40, 5: 50}

>>> d2

Traceback (most recent call last):

  File "<pyshell#64>", line 1, in <module>

    d2

NameError: name 'd2' is not defined

>>> d2=d1.copy()

>>> d2

{1: 40, 2: 50, 3: 70, 4: 40, 5: 50}

>>> d2[1:4]

Traceback (most recent call last):

  File "<pyshell#67>", line 1, in <module>

    d2[1:4]

TypeError: unhashable type: 'slice'

>>> k=[1,2,3,4]

>>> d3=d.fromkeys(k,10)

Traceback (most recent call last):

  File "<pyshell#69>", line 1, in <module>

    d3=d.fromkeys(k,10)

NameError: name 'd' is not defined

>>> d3=dict.fromkeys(k,10)

>>> d3

{1: 10, 2: 10, 3: 10, 4: 10}

>>> d4=dict.fromkeys(k)

>>> d4'

SyntaxError: EOL while scanning string literal

>>> d4

{1: None, 2: None, 3: None, 4: None}

>>> d1

{1: 40, 2: 50, 3: 70, 4: 40, 5: 50}

>>> k=[4,8,2,"ram"]

>>> d4=dict.fromkeys(k,30)

>>> d4

{4: 30, 8: 30, 2: 30, 'ram': 30}

>>> d1

{1: 40, 2: 50, 3: 70, 4: 40, 5: 50}

>>> d1.pop(2)

50

>>> d1

{1: 40, 3: 70, 4: 40, 5: 50}

>>> d1.popitem()

(5, 50)

>>> d1

{1: 40, 3: 70, 4: 40}

>>> min(d1)

1

>>> max(d1)

4

>>> d4

{4: 30, 8: 30, 2: 30, 'ram': 30}

>>> min(d4)

Traceback (most recent call last):

  File "<pyshell#87>", line 1, in <module>

    min(d4)

TypeError: '<' not supported between instances of 'str' and 'int'

>>> sorted(d4)

Traceback (most recent call last):

  File "<pyshell#88>", line 1, in <module>

    sorted(d4)

TypeError: '<' not supported between instances of 'str' and 'int'

>>> k=[3,7,2,1,9]

>>> d1=dict.fromkeys(k,30)

>>> d1

{3: 30, 7: 30, 2: 30, 1: 30, 9: 30}

>>> sorted(d1)

[1, 2, 3, 7, 9]

>>> sorted(d1.keys())

[1, 2, 3, 7, 9]

>>> sorted(d1.values())

[30, 30, 30, 30, 30]

>>> 

= RESTART: C:/Users/S P SHARMA/AppData/Local/Programs/Python/Python38-32/13feb.py

Traceback (most recent call last):

  File "C:/Users/S P SHARMA/AppData/Local/Programs/Python/Python38-32/13feb.py", line 5, in <module>

    if i%2==0:

TypeError: unsupported operand type(s) for %: 'tuple' and 'int'

>>> 

= RESTART: C:/Users/S P SHARMA/AppData/Local/Programs/Python/Python38-32/13feb.py

8

Traceback (most recent call last):

  File "C:/Users/S P SHARMA/AppData/Local/Programs/Python/Python38-32/13feb.py", line 5, in <module>

    if i%2==0:

TypeError: not all arguments converted during string formatting

>>> 

= RESTART: C:/Users/S P SHARMA/AppData/Local/Programs/Python/Python38-32/13feb.py

8

4

>>> 

= RESTART: C:/Users/S P SHARMA/AppData/Local/Programs/Python/Python38-32/13feb.py

Press 1. for add the details of employee: 

Press 2. for display the details of employee: 

Press 3. for delete the details of employee: 

Enter Your Choice1string formatti

Traceback (most recent call last):

  File "C:/Users/S P SHARMA/AppData/Local/Programs/Python/Python38-32/13feb.py", line 19, in <module>

    choice = int(input("Enter Your Choice"))

ValueError: invalid literal for int() with base 10: '1string formatti'

>>> 

= RESTART: C:/Users/S P SHARMA/AppData/Local/Programs/Python/Python38-32/13feb.py

Press 1. for add the details of employee: 

Press 2. for display the details of employee: 

Press 3. for delete the details of employee: 

Enter Your Choice: 1

Enter the id of emp: 101

Enter the name of emp: Ram

Enter the salary of emp: 34553

>>> 

= RESTART: C:/Users/S P SHARMA/AppData/Local/Programs/Python/Python38-32/13feb.py

Press 1. for add the details of employee: 

Press 2. for display the details of employee: 

Press 3. for delete the details of employee: 

Enter Your Choice: 1

Enter the id of emp: 101

Enter the name of emp: ram

Enter the salary of emp: 34432

Press 'y' for continue and 'n' for exity

Press 1. for add the details of employee: 

Press 2. for display the details of employee: 

Press 3. for delete the details of employee: 

Enter Your Choice: 1

Enter the id of emp: 102

Enter the name of emp: raj

Enter the salary of emp: 2342

Press 'y' for continue and 'n' for exity

Press 1. for add the details of employee: 

Press 2. for display the details of employee: 

Press 3. for delete the details of employee: 

Enter Your Choice: 1

Enter the id of emp: 103

Enter the name of emp: raman

Enter the salary of emp: 2323

Press 'y' for continue and 'n' for exitn

>>> 

= RESTART: C:/Users/S P SHARMA/AppData/Local/Programs/Python/Python38-32/13feb.py

Press 1. for add the details of employee: 

Press 2. for display the details of employee: 

Press 3. for delete the details of employee: 

Enter Your Choice: 1

Enter the id of emp: 101

Enter the name of emp: Ram

Enter the salary of emp: 23445

Press 'y' for continue and 'n' for exit: y

Press 1. for add the details of employee: 

Press 2. for display the details of employee: 

Press 3. for delete the details of employee: 

Enter Your Choice: 1

Enter the id of emp: Raj

Traceback (most recent call last):

  File "C:/Users/S P SHARMA/AppData/Local/Programs/Python/Python38-32/13feb.py", line 22, in <module>

    eid=int(input("Enter the id of emp: "))

ValueError: invalid literal for int() with base 10: 'Raj'

>>> 

= RESTART: C:/Users/S P SHARMA/AppData/Local/Programs/Python/Python38-32/13feb.py

Press 1. for add the details of employee: 

Press 2. for display the details of employee: 

Press 3. for delete the details of employee: 

Enter Your Choice: 1

Enter the id of emp: 101

Enter the name of emp: Ram

Enter the salary of emp: 23422

Press 'y' for continue and 'n' for exit: y

Press 1. for add the details of employee: 

Press 2. for display the details of employee: 

Press 3. for delete the details of employee: 

Enter Your Choice: 1

Enter the id of emp: 102

Enter the name of emp: Raj

Enter the salary of emp: 34222

Press 'y' for continue and 'n' for exit: y

Press 1. for add the details of employee: 

Press 2. for display the details of employee: 

Press 3. for delete the details of employee: 

Enter Your Choice: 1

Enter the id of emp: 103

Enter the name of emp: Sam

Enter the salary of emp: 34532

Press 'y' for continue and 'n' for exit: y

Press 1. for add the details of employee: 

Press 2. for display the details of employee: 

Press 3. for delete the details of employee: 

Enter Your Choice: 2

(103, 'Sam', 34532.0)

(102, 'Raj', 34222.0)

(101, 'Ram', 23422.0)

Press 'y' for continue and 'n' for exit: y

Press 1. for add the details of employee: 

Press 2. for display the details of employee: 

Press 3. for delete the details of employee: 

Enter Your Choice: 3

Deleted Element:  (103, 'Sam', 34532.0)

Press 'y' for continue and 'n' for exit: y

Press 1. for add the details of employee: 

Press 2. for display the details of employee: 

Press 3. for delete the details of employee: 

Enter Your Choice: 2

(102, 'Raj', 34222.0)

(101, 'Ram', 23422.0)

Press 'y' for continue and 'n' for exit: n

>>> 

= RESTART: C:/Users/S P SHARMA/AppData/Local/Programs/Python/Python38-32/13feb.py

Press 1. for add the details of employee: 

Press 2. for display the details of employee: 

Press 3. for delete the details of employee: 

Enter Your Choice: 1

Enter the id of emp: 101

Enter the name of emp: ram

Enter the salary of emp: 234

Press 'y' for continue and 'n' for exit: y

Press 1. for add the details of employee: 

Press 2. for display the details of employee: 

Press 3. for delete the details of employee: 

Enter Your Choice: 1

Enter the id of emp: 102

Enter the name of emp: raj

Enter the salary of emp: 34212

Press 'y' for continue and 'n' for exit: y

Press 1. for add the details of employee: 

Press 2. for display the details of employee: 

Press 3. for delete the details of employee: 

Enter Your Choice: 2

[(102, 'raj', 34212.0)]

Press 'y' for continue and 'n' for exit: 

= RESTART: C:/Users/S P SHARMA/AppData/Local/Programs/Python/Python38-32/13feb.py

This is a function

>>> 

= RESTART: C:/Users/S P SHARMA/AppData/Local/Programs/Python/Python38-32/13feb.py

This is a function

13

>>> 



'''

D={1:'Ram',8:'Raj',3:'Sam','id':122}

print(D)

for i in D.items():

    #print(i,"=",D[i])

    print(i)


D[5]="John"

print(D)

D[1]="Amit"

print(D)



Emp=[]

c='y'

while c=='y' or c=='Y':

    print("Press 1. for add the details of employee: ")

    print("Press 2. for display the details of employee: ")

    print("Press 3. for delete the details of employee: ")

    choice = int(input("Enter Your Choice: "))

    if choice ==1:

        eid=int(input("Enter the id of emp: "))

        ename=input("Enter the name of emp: ")

        salary=float(input("Enter the salary of emp: "))

        e=(eid,ename,salary)

        Emp.append(e)

    elif choice==2:

        L=len(Emp)

        while L>0:

            print(Emp[L-1])

            L=L-1

        

    elif choice==3:

        if(Emp==[]):

            print("Empty Stack")

        else:

            print("Deleted Element: ",Emp.pop())

    else:

        print("Wrong Choice")

    c=input("Press 'y' for continue and 'n' for exit: ")

'''


def show():

    print("This is a function")


show()



def sum(a,b):

    print(a+b)


sum(5,8)


Assignment - 104 for TGT/PGT Computer Science

 

Assignment - 104

Qus: 1.

int a[4][5]={{1,2,3,4,5},{6,7,8,9,10},{11,12,13,14,15},{16,17,18,19,20}};

printf("%d",*(*(a+**a+2)+3));

(a).  14

(b).  17

(c).   19

(d).  18

(e).  None of These

Qus: 2.

Consider the following sequence of micro-operations.

     MBR ← PC

     MAR ← X 

     PC ← Y 

     Memory ← MBR

Which one of the following is a possible operation performed by this sequence?
(A) Instruction fetch
(B) Operand fetch
(C) Conditional branch
(D) Initiation of interrupt service

Qus: 3.

Two processors A and B have clock frequencies of 700 Mhz and 900 Mhz respectively. Suppose A can execute an instruction with an average of 3 steps and B can execute with an average of 5 steps. For the execution of the same instruction which processor is faster?

(a).  A

(b).  B

(c).   Both take the same time

(d).  Insufficient information

Qus: 4.

Registers are to RAM’s as Cache’s are to ___________

(a).  System stacks

(b).  Overlays

(c).   Page Table

(d).  TLB

Qus: 5.

In memory-mapped I/O ____________

(a).  The I/O devices and the memory share the same address space

(b).  The I/O devices have a separate address space

(c).   The memory and I/O devices have an associated address space

(d).  A part of the memory is specifically set aside for the I/O operation