Friday, December 30, 2022

12 CS Pre Board Dec 2022

 

SECTION - A

1. False

2. C - 18

3. C -  a

4. D - **

5. D - 4map

6. B - random

7. []  / Empty List

8. D - Server

9. C - flush()

10 . B - Stop

11 . A - SMTP, POP

12. B - ALTER

13. A - read()

14. A - 0

15. C - (comma) ,

16. B - commit()

17. A

18. A

SECTION - B

Q: 19.

def swap(d):

    n = {}

    values = d.values()

    keys = list(d.keys())

    k = 0

    for i in values:

        n[i] = keys[k]

        k=k+1

    return n

result = swap({'a':1,'b':2,'c':3})

print(result)


Output:

{1: 'a', 2: 'b', 3: 'c'}

Q: 20

Cookies are small pieces of text sent to your browser by a website you visit. They help that website remember information about your visit, which can both make it easier to visit the site again and make the site more useful to you.

Advantages

Cookies are extremely user friendly.

Disadvantages

Size limitations also exist on cookies. They cannot store large amount of information. Most cookies are able to store information only up to 4kb.

OR

Client-side scripting

It runs on the user’s computer.

HTML, CSS, and JavaScript are used.

Server-side scripting

It runs on the webserver.

PHP, Python, Java, Ruby are used.

Q: 21 (a)

mystring = 'Programming is Fun'

print(mystring[-50:10:2].swapcase())

pORMI

Q: 21 (b)

a,b,c,d = (1,2,3,4)

mytuple = (a,b,c,d)*2+(5**2,)

print(len(mytuple)+2)

11


No comments:

Post a Comment