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


Friday, 12 February 2021

Practical - 25: Python MySql Connectivity for class 12 CS and IP

 

'''Practical No: 25: - Write a menu driven program to demonstrate add, display, update, delete and exit, performed on a Employee table containing (eid, ename, salary) through python-MySql connectivity.'''

import mysql.connector


con=mysql.connector.connect(host="localhost",username="root",passwd="root")


mycursor=con.cursor()


mycursor.execute("create database if not exists spsharmag")


mycursor.execute("use spsharmag")


mycursor.execute("create table if not exists Employee (eid int primary key, ename varchar(20), salary float(8,2))")

c="y"

while(c=="y" or c=="Y"):

    print("1. Press 1 for add new Employee: ")

    print("2. Press 2 for Show the details of Employees: ")

    print("3. Press 3 for Update Employee Details: ")

    print("4. Press 4 for Delete Employee Details: ")

    print("5. Press 5 for Exit: ")

    choice=int(input("Enter Your Choice 1 or 2 or 3 or 4 or 5: "))

    if(choice==1):

        eid=int(input("Enter Employee Id: "))

        ename=input("Enter Employee Name: ")

        salary=input("Enter Employee Salary: ")

        mycursor.execute("insert into Employee values(%s,%s,%s)",(eid,ename,salary))

        con.commit()

    elif(choice==2):

        mycursor.execute("select * from Employee")

        myemp=mycursor.fetchall()

        for x in myemp:

            print(x)

    elif(choice==3):

        eid=int(input("Enter the Employee id for update: "))

        ename=input("Enter Employee New Name: ")

        salary=input("Enter Employee New Salary: ")

        mycursor.execute("update Employee set ename=%s,salary=%s where eid=%s",(ename,salary,eid))

        con.commit()

    elif(choice==4):

        eid=int(input("Enter the Employee id for delete: "))

        mycursor.execute("delete from Employee where eid=%s",(eid,))

        con.commit()

    elif(choice==5):

        break

    else:

        print("Wrong Choice")

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






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.

>>> 

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

1. Press 1 for add new Employee: 

2. Press 2 for Show the details of Employees: 

3. Press 3 for Update Employee Details: 

4. Press 4 for Delete Employee Details: 

5. Press 5 for Exit: 

Enter Your Choice 1 or 2 or 3 or 4 or 5: 1

Enter Employee Id: 101

Enter Employee Name: S P SHARMA

Enter Employee Salary: 234567

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

1. Press 1 for add new Employee: 

2. Press 2 for Show the details of Employees: 

3. Press 3 for Update Employee Details: 

4. Press 4 for Delete Employee Details: 

5. Press 5 for Exit: 

Enter Your Choice 1 or 2 or 3 or 4 or 5: 1

Enter Employee Id: 102

Enter Employee Name: Shubham

Enter Employee Salary: 123456

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

1. Press 1 for add new Employee: 

2. Press 2 for Show the details of Employees: 

3. Press 3 for Update Employee Details: 

4. Press 4 for Delete Employee Details: 

5. Press 5 for Exit: 

Enter Your Choice 1 or 2 or 3 or 4 or 5: 1

Enter Employee Id: 103

Enter Employee Name: Saanvi

Enter Employee Salary: 134567

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

1. Press 1 for add new Employee: 

2. Press 2 for Show the details of Employees: 

3. Press 3 for Update Employee Details: 

4. Press 4 for Delete Employee Details: 

5. Press 5 for Exit: 

Enter Your Choice 1 or 2 or 3 or 4 or 5: 2

(101, 'S P SHARMA', 234567.0)

(102, 'Shubham', 123456.0)

(103, 'Saanvi', 134567.0)

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

1. Press 1 for add new Employee: 

2. Press 2 for Show the details of Employees: 

3. Press 3 for Update Employee Details: 

4. Press 4 for Delete Employee Details: 

5. Press 5 for Exit: 

Enter Your Choice 1 or 2 or 3 or 4 or 5: 3

Enter the Employee id for update: 102

Enter Employee New Name: Shubham Bhardwaj

Enter Employee New Salary: 174568

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

1. Press 1 for add new Employee: 

2. Press 2 for Show the details of Employees: 

3. Press 3 for Update Employee Details: 

4. Press 4 for Delete Employee Details: 

5. Press 5 for Exit: 

Enter Your Choice 1 or 2 or 3 or 4 or 5: 2

(101, 'S P SHARMA', 234567.0)

(102, 'Shubham Bhardwaj', 174568.0)

(103, 'Saanvi', 134567.0)

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

1. Press 1 for add new Employee: 

2. Press 2 for Show the details of Employees: 

3. Press 3 for Update Employee Details: 

4. Press 4 for Delete Employee Details: 

5. Press 5 for Exit: 

Enter Your Choice 1 or 2 or 3 or 4 or 5: 4

Enter the Employee id for delete: 101

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

1. Press 1 for add new Employee: 

2. Press 2 for Show the details of Employees: 

3. Press 3 for Update Employee Details: 

4. Press 4 for Delete Employee Details: 

5. Press 5 for Exit: 

Enter Your Choice 1 or 2 or 3 or 4 or 5: 2

(102, 'Shubham Bhardwaj', 174568.0)

(103, 'Saanvi', 134567.0)

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

>>> 

Practical - 23: Python MySql Connectivity for class 12 CS and IP

 

'''Practical No: 23: - Write a menu driven program to demonstrate add, display, update, delete and exit, performed on a Student table containing  (sid, sname, course) through python-MySql connectivity.'''

import mysql.connector


con=mysql.connector.connect(host="localhost",username="root",passwd="root")


mycursor=con.cursor()


mycursor.execute("create database if not exists spsharmag")


mycursor.execute("use spsharmag")


mycursor.execute("create table if not exists Student (sid int primary key, sname varchar(20), course varchar(20))")

c="y"

while(c=="y" or c=="Y"):

    print("1. Press 1 for add new Student: ")

    print("2. Press 2 for Show the details of Students: ")

    print("3. Press 3 for Update Student Details: ")

    print("4. Press 4 for Delete Student Details: ")

    print("5. Press 5 for Exit: ")

    choice=int(input("Enter Your Choice 1 or 2 or 3 or 4 or 5: "))

    if(choice==1):

        sid=int(input("Enter Student Id: "))

        sname=input("Enter Student Name: ")

        course=input("Enter Student Course: ")

        mycursor.execute("insert into Student values(%s,%s,%s)",(sid,sname,course))

        con.commit()

    elif(choice==2):

        mycursor.execute("select * from Student")

        mystudents=mycursor.fetchall()

        for x in mystudents:

            print(x)

    elif(choice==3):

        sid=int(input("Enter the Student id for update: "))

        sname=input("Enter Student New Name: ")

        course=input("Enter Student New Course: ")

        mycursor.execute("update Student set sname=%s,course=%s where sid=%s",(sname,course,sid))

        con.commit()

    elif(choice==4):

        cid=int(input("Enter the Student id for delete: "))

        mycursor.execute("delete from Student where sid=%s",(sid,))

        con.commit()

    elif(choice==5):

        break

    else:

        print("Wrong Choice")

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







Practical - 22: Python MySql Connectivity for class 12 CS and IP

 '''Practical No: 22: - Write a menu driven program to demonstrate add, display, update, delete and exit, performed on a table club containing (cid, cname, city) through python-MySql connectivity.'''

import mysql.connector


con=mysql.connector.connect(host="localhost",username="root",passwd="root")


mycursor=con.cursor()


mycursor.execute("create database if not exists spsharmag")


mycursor.execute("use spsharmag")


mycursor.execute("create table if not exists club (cid int primary key, cname varchar(20),city varchar(20))")

c="y"

while(c=="y" or c=="Y"):

    print("1. Press 1 for add new club: ")

    print("2. Press 2 for Show the details of club: ")

    print("3. Press 3 for Update club Details: ")

    print("4. Press 4 for Delete club Details: ")

    print("5. Press 5 for Exit: ")

    choice=int(input("Enter Your Choice 1 or 2 or 3 or 4 or 5: "))

    if(choice==1):

        cid=int(input("Enter club Id: "))

        cname=input("Enter club Name: ")

        city=input("Enter club city: ")

        mycursor.execute("insert into club values(%s,%s,%s)",(cid,cname,city))

        con.commit()

    elif(choice==2):

        mycursor.execute("select * from club")

        myclubs=mycursor.fetchall()

        for x in myclubs:

            print(x)

    elif(choice==3):

        cid=int(input("Enter the club id for update: "))

        cname=input("Enter club New Name: ")

        city=input("Enter club New city: ")

        mycursor.execute("update club set cname=%s,city=%s where cid=%s",(cname,city,cid))

        con.commit()

    elif(choice==4):

        cid=int(input("Enter the club id for delete: "))

        mycursor.execute("delete from club where mid=%s",(cid,))

        con.commit()

    elif(choice==5):

        break

    else:

        print("Wrong Choice")

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







Tuples in Python

 '''import sys

print("Apne 3 frd ka name likho: ")

a=sys.stdin.readlines()

for i in a:

    print(i,end="")


print("**************")


L=[]

T=()

for i in range(5):

    a=int(input("Enter a number : "))

    L.append(a)

    T=T+(a,)

print(L)

print(T)


c="y"

while c=="y" or c=="Y":

    print("Available Choices: ")

    print("1. Temp Convert from F to C")

    print("2. Temp Convert from C to F")

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

    if choice==1:

        fahrenheit = float(input("Enter temperature in F: "))

        

        celsius=(fahrenheit-32)*(5/9)

        print('%.2f fahrenheit is: %0.2f celsius' %(fahrenheit, celsius))

    elif choice==2:

        celsius = float(input("Enter temperature in celsius: "))

        fahrenheit = (celsius * 9/5) + 32

        print('%.2f Celsius is: %0.2f Fahrenheit' %(celsius, fahrenheit))

    else:

        print("Wrong Choice")

    c=input("Do you want to continue(y/n): ")



n=int(input("Enter no of stars you want: "))

k = n - 1

for i in range(1, n+1):

    for s in range(1, k+1):

        print(end=" ")

    k = k - 1

    for j in range(0, i):

        print(j+1, end=" ")

        

    print("")

    



for i in range(5):

    num = 1

    for j in range(5, i, -1):

        print(num, end=" ")

        num = num + 1

    print()


'''


n=int(input("Enter no of stars you want: "))

k = n - 1

m=1

for i in range(1, n+1):

    for s in range(1, k+1):

        print(end=" ")

    k = k - 1

    for j in range(0, m):

        print("*", end="")

        

    print("")

    m=m+2












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.

>>> A=(1,3,5)

>>> A

(1, 3, 5)

>>> L=[5,7,9]

>>> L

[5, 7, 9]

>>> 

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

Hello

>>> 

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

Kuch To Likhohello

>>> 

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

Apne 3 frd ka name likho: Ram

>>> 

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

Apne 3 frd ka name likho: Ram Raj

>>> 

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

Traceback (most recent call last):

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

    input("Apne 3 frd ka name likho: ",a,b,c)

NameError: name 'a' is not defined

>>> 

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

Apne 3 frd ka name likho: 

Ram

Raj

Sam

>>> 

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

Apne 3 frd ka name likho: 

Ram

Raj

Sam

['Ram\n', 'Raj\n', 'Sam\n']

>>> 

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

Apne 3 frd ka name likho: 

Ram

Raj

Sam

['Ram\n', 'Raj\n', 'Sam\n']

['Ram\n', 'Raj\n', 'Sam\n']

['Ram\n', 'Raj\n', 'Sam\n']

>>> 

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

Apne 3 frd ka name likho: 

Ram

Raj

Sam

Ram


Raj


Sam


>>> 

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

Apne 3 frd ka name likho: 

Ram

Raj

Sam

Ram

Raj

Sam

>>> 

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

Enter a number : 3

Enter a number : 5

Enter a number : 7

Enter a number : 9

Enter a number : 2

[3, 5, 7, 9, 2]

>>> 

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

Enter a number : 1

Traceback (most recent call last):

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

    T.append(a)

AttributeError: 'tuple' object has no attribute 'append'

>>> T=(1,2)

>>> T=(1,2)+(3,4)

>>> T

(1, 2, 3, 4)

>>> T=T=5

>>> T

5

>>> T=(1,2,3)

>>> T=T+5

Traceback (most recent call last):

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

    T=T+5

TypeError: can only concatenate tuple (not "int") to tuple

>>> 

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

Enter a number : 3

Enter a number : 5

Enter a number : 7

Enter a number : 9

Enter a number : 2

[3, 5, 7, 9, 2]

(3, 5, 7, 9, 2)

>>> range(4)

range(0, 4)

>>> list(range(4))

[0, 1, 2, 3]

>>> tuple(range(4))

(0, 1, 2, 3)

>>> t1=(1,2,3)

>>> t2=("a","b")

>>> t3=t1+t2

>>> t3

(1, 2, 3, 'a', 'b')

>>> t4=(t1,t2)

>>> t4

((1, 2, 3), ('a', 'b'))

>>> t3[2]

3

>>> 

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

Enter a number : 3

Enter a number : 4

Enter a number : 5

Enter a number : 6

Enter a number : 7

[3, 4, 5, 6, 7]

(3, 4, 5, 6, 7)

>>> t=(1,2,3)

>>> t=t+4

Traceback (most recent call last):

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

    t=t+4

TypeError: can only concatenate tuple (not "int") to tuple

>>> t=t*2

>>> t

(1, 2, 3, 1, 2, 3)

>>> t[2:5]

(3, 1, 2)

>>> t[2:3]

(3,)

>>> t[2]

3

>>> 3 in t

True

>>> 4 in t

False

>>> 3 in (3,4,5,7)

True

>>> len(t)

6

>>> t.count(3)

2

>>> any(t)

True

>>> a=()

>>> any(a)

False

>>> b=(3,)

>>> any(b)

True

>>> a=(4,9,2,7)

>>> min(a)

2

>>> max(a)

9

>>> b=(4,"ram",2,"raj")

>>> b

(4, 'ram', 2, 'raj')

>>> min(b)

Traceback (most recent call last):

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

    min(b)

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

>>> c=("ram","amit","sumit")

>>> min(c)

'amit'

>>> max(c)

'sumit'

>>> d=[4,9,2,7]

>>> min(d)

2

>>> max(d)

9

>>> d=[4,"ram"]

>>> min(d)

Traceback (most recent call last):

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

    min(d)

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

>>> max(d)

Traceback (most recent call last):

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

    max(d)

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

>>> e=(1,3.5)

>>> min(e)

1

>>> max(e)

3.5

>>> a=(4,9,2,7)

>>> sum(a)

22

>>> sorted(a)

[2, 4, 7, 9]

>>> a

(4, 9, 2, 7)

>>> a=(4,9,2,7,4,5,4,1)

>>> a

(4, 9, 2, 7, 4, 5, 4, 1)

>>> a.count(7)

1

>>> a.count(4)

3

>>> a.index(4)

0

>>> a.index(4,1)

4

>>> a.index(4,1,3)

Traceback (most recent call last):

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

    a.index(4,1,3)

ValueError: tuple.index(x): x not in tuple

>>> a.index(4,1,4)

Traceback (most recent call last):

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

    a.index(4,1,4)

ValueError: tuple.index(x): x not in tuple

>>> a.index(4,1,5)

4

>>> a

(4, 9, 2, 7, 4, 5, 4, 1)

>>> 9 in a

True

>>> b=(1,2,3)

>>> c=(1,2,3)

>>> d=(3,4,5)

>>> b==c

True

>>> b==d

False

>>> b>d

False

>>> d>b

True

>>> e=(0,4,5)

>>> e>b

False

>>> e

(0, 4, 5)

>>> del e

>>> e

Traceback (most recent call last):

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

    e

NameError: name 'e' is not defined

>>> p=[1,2,3]

>>> del p

>>> p

Traceback (most recent call last):

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

    p

NameError: name 'p' is not defined

>>> e=4,6,8

>>> a=4

>>> a

4

>>> del a

>>> a

Traceback (most recent call last):

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

    a

NameError: name 'a' is not defined

>>> e=4,5,6

>>> e

(4, 5, 6)

>>> a,b,c=e

>>> a

4

>>> b

5

>>> c

6

>>> e

(4, 5, 6)

>>> a,b=e

Traceback (most recent call last):

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

    a,b=e

ValueError: too many values to unpack (expected 2)

>>> a,b,c,d=e

Traceback (most recent call last):

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

    a,b,c,d=e

ValueError: not enough values to unpack (expected 4, got 3)

>>> 

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

Enter temperature in celsius: 37

37.00 Celsius is: 98.60 Fahrenheit

>>> 

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

Available Choices: 

1. Temp Convert from F to C

2. Temp Convert from C to F

Enter Your Choice

Traceback (most recent call last):

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

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

KeyboardInterrupt

>>> 

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

Available Choices: 

1. Temp Convert from F to C

2. Temp Convert from C to F

Enter Your Choice: 1

Enter temperature in F: 98.6

98.60 fahrenheit is: 37.00 celsius

>>> 

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

Available Choices: 

1. Temp Convert from F to C

2. Temp Convert from C to F

Enter Your Choice: 2

Enter temperature in celsius: 37

37.00 Celsius is: 98.60 Fahrenheit

>>> 

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

Available Choices: 

1. Temp Convert from F to C

2. Temp Convert from C to F

Enter Your Choice: 1

Enter temperature in F: 98.6

98.60 fahrenheit is: 37.00 celsius

Do you want to continue(y/n)y

Available Choices: 

1. Temp Convert from F to C

2. Temp Convert from C to F

Enter Your Choice: 1

Enter temperature in F: 100

100.00 fahrenheit is: 37.78 celsius

Do you want to continue(y/n)y

Available Choices: 

1. Temp Convert from F to C

2. Temp Convert from C to F

Enter Your Choice: 2

Enter temperature in celsius: 37

37.00 Celsius is: 98.60 Fahrenheit

Do you want to continue(y/n)y

Available Choices: 

1. Temp Convert from F to C

2. Temp Convert from C to F

Enter Your Choice: 2

Enter temperature in celsius: 80

80.00 Celsius is: 176.00 Fahrenheit

Do you want to continue(y/n)n

>>> 

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

Enter no of stars you want: 5

    


   1 


  1 2 


 1 2 3 


1 2 3 4 


>>> 

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

Enter no of stars you want: 5

    


   1 


  1 2 


 1 2 3 


1 2 3 4 


1 2 3 4 5 


>>> 

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

Enter no of stars you want: 4

   0 


  0 1 


 0 1 2 


0 1 2 3 


>>> 

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

Enter no of stars you want: 4

   1 


  1 2 


 1 2 3 


1 2 3 4 


>>> 

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

Enter no of stars you want: 5

    1 


   1 2 


  1 2 3 


 1 2 3 4 


1 2 3 4 5 


>>> 

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

Enter no of stars you want: 5

    1 


   1 2 


  1 2 3 


 1 2 3 4 


1 2 3 4 5 


>>> 

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

Enter no of stars you want: 5

    1 

   1 2 

  1 2 3 

 1 2 3 4 

1 2 3 4 5 

>>> 

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

1 2 3 4 5 

1 2 3 4 

1 2 3 

1 2 

>>> d={}

>>> d

{}

>>> d=dict()

>>> d

{}

>>> d={1:"Ram",2:"Raj"}

>>> d

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

>>> d1={1:1,2:4,3:9,1:3}

>>> d1

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

>>> 

>>> 

>>> 



>>> 


>>> 


>>> 


>>> 

>>> 

>>> 



>>> 

>>> 

>>> 

>>>