KnowledgeBoat Logo
OPEN IN APP

Practice Paper

Practice Paper

Class 11 - Computer Science with Python Preeti Arora



Section A (1 Mark Each)

Question 1

Arithmetic Logic Unit and Control Unit of a computer together are known as ............... .

  1. Central Processing Unit
  2. Memory Unit
  3. I/O Unit
  4. Operating Unit

Answer

Central Processing Unit

Reason — Arithmetic and logic unit along with control unit of a computer, combined into a single unit, is known as central processing unit.

Question 2

............... is logically equivalent to an inverted XOR gate.

  1. AND
  2. XNOR
  3. OR
  4. NOR

Answer

XNOR

Reason — An XOR gate outputs true only when the inputs are different. The XNOR gate, being the inverse of the XOR gate, outputs true when the inputs are the same. This means that the XNOR gate behaves exactly like an XOR gate with its output inverted, making it logically equivalent to an inverted XOR gate.

Question 3

The smallest individual unit in a program is known as ............... .

  1. Digits
  2. Tokens
  3. Literals
  4. Units

Answer

Tokens

Reason — The smallest individual unit in a program is known as a token.

Question 4

Which of the following is an invalid data type in Python?

  1. Sets
  2. Real
  3. Integer
  4. None of these

Answer

Real

Reason — Real is not a standard built-in data type in Python.

Question 5

What will be the output of the following code?

import math
x = 100
print(x>0 and math.sqrt(x))
  1. True
  2. 1
  3. 10
  4. 10.0

Answer

10.0

Reason — The code first imports the math module to access mathematical functions. It then assigns the value 100 to the variable x. The print statement checks whether x > 0, which is True because x is 100. Since the and operator is used, and the first condition is True, the code proceeds to evaluate math.sqrt(x), which calculates the square root of x. The square root of 100 is 10.0, so the print statement outputs 10.0.

Question 6

............... is a network security system, either hardware-based or software-based, that controls the incoming and outgoing network traffic based on a set of rules.

  1. Firewall
  2. Antivirus Software
  3. VMware
  4. Adware

Answer

Firewall

Reason — A firewall is a network security system, either hardware-based or software-based, that controls incoming and outgoing network traffic based on a set of predefined security rules.

Question 7

Kritika wants to divide a number and store the result without decimal places into an integer variable. Suggest an appropriate operator from the following:

  1. /
  2. %
  3. //
  4. Both (a) and (b)

Answer

//

Reason — The // operator is the floor division operator, which divides the number and returns the result as an integer by discarding the decimal part.

Question 8

Which of the following methods splits the string at the first occurrence of separator and returns a tuple containing three items?

  1. index()
  2. partition()
  3. split()
  4. count()

Answer

partition()

Reason — The partition() method splits the string at the first occurrence of the specified separator and returns a tuple containing three elements: the part before the separator, the separator itself, and the part after the separator.

Question 9

Find the output of the following:

for i in range(20, 30, 2):
    print (i)

1.

21  
22  
23  
24  
25

2.

21  
23  
25  
27  
29

3. SyntaxError
4.

20  
22  
24  
26  
28 

Answer

20
22
24
26
28

Reason — The code uses a for loop with range(20, 30, 2), generating numbers from 20 to 28 with a step of 2. It iterates through these values, printing each number (20, 22, 24, 26, 28) on a new line.

Question 10

Which of the following functions will return the first three characters of a string named 's'?

  1. s[3:]
  2. s[:3]
  3. s[-3:]
  4. s[:-3]

Answer

s[:3]

Reason — The slice s[:3] returns the first three characters of the string s. The slice starts from the beginning (index 0) up to index 2.

Question 11

Observe the given code and select the appropriate output.

Tuple given: tup1 = (10, 20, 30, 40, 50, 60, 70, 80, 90)

What will be the output of: print(tup1[3:7:2])

  1. (40, 50, 60, 70, 80)
  2. (40, 50, 60, 70)
  3. (40, 60)
  4. Error

Answer

(40, 60)

Reason — The slice tup1[3:7:2] extracts elements starting from index 3 up to index 6, with a step of 2. This means it selects elements at indices 3, 5, resulting in the tuple (40, 60). The print statement outputs these selected elements.

Question 12

Select the correct output of the following string operators.

str1='One'
print(str1[:3] + 'Two' + str1[-3:])
  1. OneOneTwo
  2. TwoOneOne
  3. OneTwoOne
  4. Error

Answer

OneTwoOne

Reason — The code uses str1[:3] to extract the first three characters of str1, which are 'One', and str1[-3:] to extract the last three characters, which are also 'One'. It then concatenates these with 'Two', resulting in 'OneTwoOne', which is printed.

Question 13

When a list is contained in another list as a member-element, it is called ............... .

  1. Nested tuple
  2. Nested list
  3. Array
  4. List

Answer

Nested list

Reason — When a list is contained within another list as an element, it is called a nested list.

Question 14

The ............... method removes the last entered element from the dictionary.

  1. pop()
  2. remove()
  3. popitem()
  4. del

Answer

popitem()

Reason — The popitem() method removes and returns the last entered key-value pair from the dictionary.

Question 15

Srishti is down with fever, so she decides not to go to school. The next day, she calls up her classmate Shaurya and enquires about the computer class. She also requests him to explain the concept taught in the class. Shaurya quickly downloads a 2-minute video clip from the internet explaining the concept of Tuples in Python. Using video editor, he adds this text in the downloaded video clip: "Prepared by Shaurya". Then, he emails the modified video clip to Srishti. This act of Shaurya is an example of:

  1. Fair use
  2. Hacking
  3. Copyright infringement
  4. Cyber crime

Answer

Copyright infringement

Reason — Shaurya downloading, modifying, and emailing a video clip without proper authorization from the original content creator constitutes copyright infringement.

Question 16

............... are the records and traces individuals leave behind as they use the internet.

  1. Digital footprints
  2. Cookies
  3. Website
  4. URL

Answer

Digital footprints

Reason — Digital footprints are the records and traces individuals leave behind as they use the internet.

Question 17

Assertion (A): In Python, a variable can hold values of different types at different times.

Reason (R): Once assigned, a variable's data type remains fixed throughout the program.

  1. Both A and R are true and R is the correct explanation of A.
  2. Both A and R are true but R is not the correct explanation of A.
  3. A is true but R is false.
  4. A is false but R is true.

Answer

A is true but R is false.

Explanation
In Python, variables are dynamically typed, so they can hold values of different types at different times. This means that a variable's data type is not fixed once assigned, and Python allows changing the type of a variable during the program's execution.

Question 18

Assertion (A): Python lists allow modifying their elements by indexes easily.

Reason (R): Python lists are mutable.

  1. Both A and R are true and R is the correct explanation of A.
  2. Both A and R are true but R is not the correct explanation of A.
  3. A is true but R is false.
  4. A is false but R is true.

Answer

Both A and R are true and R is the correct explanation of A.

Explanation
Python lists allow modifying their elements using indexes. This is possible because Python lists are mutable, meaning their contents can be changed after creation.

Section B (2 Marks Each)

Question 19

Convert the following binary numbers into decimal:

(a) 10010

(b) 101010

Answer

(a) 10010

Binary
No
PowerValueResult
0 (LSB)2010x1=0
12121x2=2
02240x4=0
02380x8=0
1 (MSB)24161x16=16

Equivalent decimal number = 2 + 16 = 18

Therefore, (10010)2 = (18)10.

(b) 101010

Binary
No
PowerValueResult
0 (LSB)2010x1=0
12121x2=2
02240x4=0
12381x8=8
024160x16=0
1 (MSB)25321x32=32

Equivalent decimal number = 2 + 8 + 32 = 42

Therefore, (101010)2 = (42)10.

Question 20

Draw a logical circuit for the following equations:

  1. (A+B)C

  2. AB'+C'

Answer

1. Logical circuit for (A+B)C is shown below:

Draw a logical circuit for the following equations: Practice Paper, Computer Science with Python Preeti Arora Solutions CBSE Class 11.

2. Logical circuit for AB'+C' is shown below:

Draw a logical circuit for the following equations: Practice Paper, Computer Science with Python Preeti Arora Solutions CBSE Class 11.

Question 21

Observe the code given below and answer the following questions:

n = ............... #Statement 1
if ............... : 
#Statement 2
    print ("Please enter a positive number")
elif ............... : 
#Statement 3
    print ("You have entered 0")
else:
    ...............
#Statement 4

(a) Write the input statement to accept n number of terms — Statement 1.

(b) Write if condition to check whether the input is a positive number or not — Statement 2.

(c) Write if condition to check whether the input is 0 or not — Statement 3.

(d) Complete Statement 4.

Answer

(a) Statement 1: n = int(input("Enter a number: ")) — This statement accepts input from the user and converts it to an integer.

(b) Statement 2: if n > 0: — This condition checks if the entered number is positive.

(c) Statement 3: elif n == 0: — This condition checks if the entered number is zero.

(d) Statement 4: print("You have entered a negative number") — This statement handles the case where the number is negative.

Question 22

Explain the membership operators in String.

Answer

Python offers two membership operators for checking whether a particular character exists in the given string or not. These operators are 'in' and 'not in'.

'in' operator — It returns true if a character/substring exits in the given string.

'not in' operator — It returns true if a character/substring does not exist in the given string.

To use membership operator in strings, it is required that both the operands used should be of string type, i.e., <substring> in <string> and <substring> not in <string>.

Question 23(a)

Differentiate between append() and extend() methods and provide examples of each.

Answer

append() methodextend() method
The append() method adds a single item to the end of the list. The single element can be list, number, strings, dictionary etc.The extend() method adds one list at the end of another list.
The syntax is list.append(item).The syntax is list.extend(list1).
For example,
list1 = [1, 2, 3]
list1.append(4)
print(list1)
For example,
list1 = [1, 2, 3]
list1.extend([4, 5])
print(list1)

Question 23(b)

Consider the string mySubject:

mySubject = "Computer Science"

What will be the output of:

  1. print(mySubject[:3])
  2. print(mySubject[-5:-1])
  3. print(mySubject[::-1])
  4. print(mySubject*2)

Answer

  1. Com
  2. ienc
  3. ecneicS retupmoC
  4. Computer ScienceComputer Science

Explanation

  1. The slice mySubject[:3] takes characters from the start ('C') of the string up to index 2 ('m') and prints it.
  2. The code print(mySubject[-5:-1]) uses negative indexing to slice the string. It starts from the fifth character from the end ('i') and ends before the last character ('c'), outputting ienc.
  3. The code print(mySubject[::-1]) reverses the string using slicing. The [::-1] notation means to start from the end and move backwards, outputting ecneicS retupmoC.
  4. When an integer is multiplied by a string in Python, it repeats the string the specified number of times. Hence, the code print(mySubject*2) repeats the string stored in mySubject twice.

Question 24(a)

Consider the dictionary stateCapital:

stateCapital = {"AndhraPradesh" : "Hyderabad",
                "Bihar" : "Patna", 
                "Maharashtra" : "Mumbai", 
                "Rajasthan" : "Jaipur"}

Find the output of the following statements:

  1. print(stateCapital.get("Bihar"))
  2. print(stateCapital.keys())
  3. print(stateCapital.values())
  4. print(stateCapital.items())

Answer

  1. Patna
  2. dict_keys(['AndhraPradesh', 'Bihar', 'Maharashtra', 'Rajasthan'])
  3. dict_values(['Hyderabad', 'Patna', 'Mumbai', 'Jaipur'])
  4. dict_items([('AndhraPradesh', 'Hyderabad'), ('Bihar', 'Patna'), ('Maharashtra', 'Mumbai'), ('Rajasthan', 'Jaipur')])

Question 24(b)

What are the ways by which websites track us?

Answer

The ways by which websites track us online are as follows:

  1. IP Address — From our IP address, a website can determine our rough geographical location.
  2. Cookies and Tracking Scripts — They can identify and track our browsing activity across a website.
  3. HTTP Referrer — When a link to an outside website on a webpage is clicked, then the linked website will get opened and internally our information will be provided to the linked website.
  4. Super Cookies — Super Cookies are persistent cookies that come back even after we delete them.
  5. User Agent — It tells websites our browser and operating system, providing another piece of data that can be stored and used to target ads.

Question 25(a)

What is IPR infringement and what are the forms of IPR infringement?

Answer

Intellectual Property Rights (IPR) infringement refers to any violation or breach of protected intellectual property rights.

The forms of IPR infringement are as follows:

  1. Plagiarism
  2. Copyright infringement
  3. Trademark infringement

Question 25(b)

Differentiate between copyright and plagiarism.

Answer

CopyrightPlagiarism
Copyright is a legal protection for creators of original works like books, music, software, etc. It gives them exclusive rights to use, distribute, and profit from their work.Plagiarism is copying someone else's work and then passing it off as one's own.
Copyright infringement occurs when someone uses a copyrighted work without permission, potentially facing legal consequences.Plagiarism can be accidental/unintentional or deliberate/intentional. For work that is in the public domain or not protected by copyright, it can still be plagiarized if proper credit is not given.

Section C (3 Marks Each)

Question 26

Draw a flow chart to print even numbers from 2 to 10 using the loop approach and provide its algorithm.

Answer

Flowchart:

Draw a flow chart to print even numbers from 2 to 10 using the loop approach and provide its algorithm. Practice Paper, Computer Science with Python Preeti Arora Solutions CBSE Class 11.

Algorithm:

  1. Start
  2. Initialize the variable num to 2.
  3. Repeat while num is less than or equal to 10:
    Print num.
    Increment num by 2.
  4. End

Question 27(a)

What will be the output of the following code? Also, give the minimum and maximum values of the variable x.

import random
List = ["Delhi", "Mumbai", "Chennai", "Kolkata"]
for y in range(4):
    x = random.randint(1, 3)
    print(List[x], end = "#")

Answer

Minimum Value of x: 1
Maximum Value of x: 3

Output
Mumbai#Mumbai#Mumbai#Kolkata#
Explanation

The random.randint(1, 3) function generates a random integer between 1 and 3 (inclusive) in each iteration of the loop. Based on the code, the output will consist of four city names from the List:

  1. The List contains: ["Delhi", "Mumbai", "Chennai", "Kolkata"].
  2. List[x] will access the element at index x in the list.
  3. The values of x will be between 1 and 3, meaning the cities "Mumbai", "Chennai", and "Kolkata" will be printed in a random order for each iteration.
  4. Since the code uses random.randint(1, 3), the index x can never be 0, so "Delhi" (at index 0) will not be printed.
  5. The print statement uses end="#", meaning each city name will be followed by a # symbol without a newline between them.

Question 27(b)

Explain the given built-in string functions and provide the syntax and example of each.

(a) replace()

(b) title()

(c) partition()

Answer

(a) replace() — This function replaces all the occurrences of the old string with the new string. The syntax is str.replace(old, new).

For example,

str1 = "This is a string example"
print(str1.replace("is", "was"))
Output
Thwas was a string example

(b) title() — This function returns the string with first letter of every word in the string in uppercase and rest in lowercase. The syntax is str.title().

For example,

str1 = "hello ITS all about STRINGS!!"
print(str1.title())
Output
Hello Its All About Strings!!

(c) partition() — The partition() function is used to split the given string using the specified separator and returns a tuple with three parts: substring before the separator, separator itself, a substring after the separator. The syntax is str.partition(separator), where separator argument is required to separate a string. If the separator is not found, it returns the string itself followed by two empty strings within parenthesis as tuple.

For example,

str3 = "xyz@gmail.com"
result = str3.partition("@")
print(result)
Output
('xyz', '@', 'gmail.com')

Question 28(a)

Write a program to count the frequency of a given element in a list of numbers.

Solution
my_list = eval(input("Enter the list: "))
c = int(input("Enter the element whose frequency is to be checked: "))
frequency = my_list.count(c)
print("The frequency of", c, "in the list is: ", frequency)
Output
Enter the list: [1, 2, 3, 4, 1, 2, 1, 3, 4, 5, 1]
Enter the element whose frequency is to be checked: 1
The frequency of 1 in the list is:  4

Question 28(b)

Write a program to check if the smallest element of a tuple is present at the middle position of the tuple.

Solution
tup = (5, 9, 1, 8, 7)
smallest = min(tup)
middle_index = len(tup) // 2
if tup[middle_index] == smallest:
    print("The smallest element is at the middle position.")
else:
    print("The smallest element is NOT at the middle position.")
Output
The smallest element is at the middle position.

Question 29

What are the characteristics of Dictionary?

Answer

The characteristics of dictionary are as follows:

  1. Each key maps to a value — The association of a key and a value is called a key-value pair. However, there is no order defined for the pairs, thus, dictionaries are unordered.

  2. Each key is separated from its value by a colon (:). The items are separated by commas, and the entire dictionary is enclosed in curly braces {}.

  3. Keys are unique and immutable — Keys are unique within a dictionary while values are mutable and can be changed.

  4. Indexed by Keys — The elements in a dictionary are indexed by keys and not by their relative positions or indices.

  5. The value of a dictionary can be of any type, but the keys must be of an immutable data type such as strings, numbers or tuples.

  6. Dictionary is mutable — We can add new items, delete or change the value of existing items.

Question 30

What are the issues associated with disability while teaching and using computers?

Answer

Cognitive disabilities include conditions like autism and Down's syndrome. Some less severe conditions are called learning disabilities, such as dyslexia (difficulty with reading) and dyscalculia (difficulty with math). The functional disability perspective looks at what a person can and cannot do instead of focusing on the medical reasons behind their cognitive disabilities.

The functional cognitive disabilities may involve difficulties or deficits involving:

  1. Problem-solving
  2. Memory
  3. Visual comprehension
  4. Linguistic (speech)
  5. Attention
  6. Math comprehension
  7. Reading
  8. Verbal comprehension

Section D (4 Marks Each)

Question 31

Observe the code given below and answer the following questions. A triangle has three sides — a, b and c, and the values are 17, 23 and 30, respectively. Calculate and display its area using Heron's formula as

S=a+b+c2S =\dfrac{a+b+c}{2} ; Area=S(Sa)(Sb)(Sc)Area = \sqrt{S(S - a)(S - b)(S - c)}

(a) Import the module — Statement 1

(b) Calculate s (half of the triangle perimeter) — Statement 2

(c) Insert function to calculate area — Statement 3

(d) Display the area of triangle — Statement 4

import ...............                          #Statement 1
a, b, c = 17, 23, 30
s = ...............                             #Statement 2
area = ............... (s*(sa)*(sb)*(sc))    #Statement 3
print("Sides of triangle:", a, b, c)
print(...............)                         #Statement 4

Answer

(a) Statement 1: import math is used to access mathematical functions, specifically math.sqrt() for calculating the square root.

(b) Statement 2: s = (a + b + c) / 2 calculates the semi-perimeter of the triangle.

(c) Statement 3: area = math.sqrt(s * (s - a) * (s - b) * (s - c)) uses Heron's formula to compute the area of the triangle.

(d) Statement 4: print("Area of triangle:", area) prints the calculated area.

Question 32

Meera wants to buy a desktop/laptop. She wants to use multitasking computer for her freelancing work which involves typing and for watching movies. Her brother will also use this computer for playing/creating games.

(i) Which of the following hardware has a suitable size to support this feature? Specify the reason.

  1. ROM
  2. RAM
  3. Storage
  4. All of these

(ii) Meera also wants to use this computer while traveling. What should her preference be — desktop or laptop?

(iii) If Meera has to run Python on her laptop, what should be the minimum RAM required to run the same?

(iv) What is the difference between RAM and storage? Do we need both in a computer?

Answer

(i) RAM

Reason — RAM (Random Access Memory) is essential for multitasking as it temporarily holds data and instructions that the CPU needs while performing tasks. More RAM allows the computer to handle multiple applications simultaneously, which is crucial for both freelancing work and gaming.
While ROM (Read-Only Memory) and Storage (e.g., hard drive or SSD) are also essential, they don't directly impact the ability to multitask. ROM stores firmware, and Storage holds permanent data, but RAM specifically influences multitasking performance.

(ii) Laptops are portable and designed for use on the go, making them more suitable for travelling compared to desktops, which are stationary and typically used in a fixed location.

(iii) To run Python on her laptop, a minimum of 4 GB RAM is recommended.

(iv)

RAM (Random Access Memory)Storage
RAM is a volatile memory.Storage refers to non-volatile memory.
It temporarily holds data and instructions that the CPU needs while performing tasks.It is used to save data permanently, such as hard drives (HDDs) or solid-state drives (SSDs).
It loses its contents when the computer is turned off.It retains data even when the computer is turned off.

Yes, both are essential in a computer. RAM is crucial for the system's speed and ability to handle multiple tasks simultaneously, while storage is necessary for saving files, programs, and the operating system.

Section E (5 Marks Each)

Question 33(a)

Draw the structure of the components of a computer and briefly explain the following.

(a) Input Unit

(b) Output Unit

(c) Central Processing Unit

(d) Primary Memory

(e) Secondary Memory

Answer

Draw the block diagram of a computer system. Briefly write about the functionality of each component. Computer System Organization, Computer Science with Python Preeti Arora Solutions CBSE Class 11.
  1. Input Unit — An input unit takes/accepts input and converts it into binary form so that it can be understood by the computer. The computer input constitutes data and instructions.
    Examples: Keyboard, mouse, scanner, and microphone.
  2. Output Unit — Output unit is formed by the output devices attached to the computer. Output devices produce the output generated by the CPU in human readable form.
    Examples: Monitor, printer, and speakers.
  3. Central Processing Unit — CPU is the control centre or brain of a computer. It guides, directs, controls and governs all the processing that takes place inside the computer. The CPU consists of three components — ALU, CU and Registers.
  4. Primary Memory — The primary memory, also termed as main memory, is directly accessible to the CPU since all the work is done in the RAM and later on gets stored on the secondary storage. It is volatile, meaning it loses its data when the power is turned off. The types of primary memory are RAM and ROM.
  5. Secondary Memory — The secondary memory, also known as auxiliary memory, can be accessed by the CPU through input-output controllers or units. It is used to store a large amount of data permanently. It is non-volatile, meaning it retains data even when the computer is turned off.

Question 33(b)

Write a menu-driven program to implement a simple calculator for two numbers given by the user.

Solution
while True:
    print("Simple Calculator")
    print("1. Add")
    print("2. Subtract")
    print("3. Multiply")
    print("4. Divide")
    print("5. Exit")
    choice = input("Enter choice (1/2/3/4/5): ")

    if choice in ['1', '2', '3', '4', '5']:
        if choice == '5':
            print("Exiting the calculator.")
            break

        num1 = float(input("Enter first number: "))
        num2 = float(input("Enter second number: "))

        if choice == '1':
            result = num1 + num2
            print(num1, "+", num2, "=", result)
        elif choice == '2':
            result = num1 - num2
            print(num1, "-", num2, "=", result)
        elif choice == '3':
            result = num1 * num2
            print(num1, "*", num2, "=", result)
        elif choice == '4':
            if num2 != 0:
                result = num1 / num2
                print(num1, "/", num2, "=", result)
            else:
                print("Error! Division by zero.")
    else:
        print("Invalid choice! Please select a valid option.")
Output
Simple Calculator
1. Add
2. Subtract
3. Multiply
4. Divide
5. Exit
Enter choice (1/2/3/4/5): 1
Enter first number: 234
Enter second number: 33
234.0 + 33.0 = 267.0
Simple Calculator
1. Add
2. Subtract
3. Multiply
4. Divide
5. Exit
Enter choice (1/2/3/4/5): 2
Enter first number: 34
Enter second number: 9
34.0 - 9.0 = 25.0
Simple Calculator
1. Add
2. Subtract
3. Multiply
4. Divide
5. Exit
Enter choice (1/2/3/4/5): 3
Enter first number: 2
Enter second number: 45
2.0 * 45.0 = 90.0
Simple Calculator
1. Add
2. Subtract
3. Multiply
4. Divide
5. Exit
Enter choice (1/2/3/4/5): 4
Enter first number: 452
Enter second number: 4
452.0 / 4.0 = 113.0
Simple Calculator
1. Add
2. Subtract
3. Multiply
4. Divide
5. Exit
Enter choice (1/2/3/4/5): 5
Exiting the calculator.

Question 34(a)

Write a program that inputs a list, replicates it twice and then prints the sorted list in ascending and descending orders.

Solution
List1 = eval(input("Enter the list: "))
List2 = List1 * 2
List2.sort()
print("Sorted list in ascending order:", List2)
List2.sort(reverse=True)
print("Sorted list in descending order:", List2)
Output
Enter the list: [4, 5, 2, 9, 1, 6]
Sorted list in ascending order: [1, 1, 2, 2, 4, 4, 5, 5, 6, 6, 9, 9]
Sorted list in descending order: [9, 9, 6, 6, 5, 5, 4, 4, 2, 2, 1, 1]

Question 34(b)

Write a program to create a dictionary with the roll number, name and marks of n students in a class, and display the names of students who have secured marks above 75.

Solution
n = int(input("Enter the number of students: "))
student_data = {}

for i in range(n):
    roll_number = int(input("Enter roll number for student: "))
    name = input("Enter name for student: ")
    marks = int(input("Enter marks for student: "))
    student_data[roll_number] = {'name': name, 'marks': marks}
print(student_data)

print("Students who have secured marks above 75:")
for roll_number, details in student_data.items():
    if details['marks'] > 75:
        print(details['name'])
Output
Enter the number of students: 4
Enter roll number for student: 5
Enter name for student: Ashish Kumar
Enter marks for student: 67
Enter roll number for student: 4
Enter name for student: Samay
Enter marks for student: 79
Enter roll number for student: 5
Enter name for student: Rohini 
Enter marks for student: 89
Enter roll number for student: 6
Enter name for student: Anusha
Enter marks for student: 73
{5: {'name': 'Rohini', 'marks': 89}, 4: {'name': 'Samay', 'marks': 79}, 6: {'name': 'Anusha', 'marks': 73}}
Students who have secured marks above 75:
Rohini
Samay

Question 35

Explain any five social media etiquettes.

Answer

The social media etiquettes are as follows:

  1. Choose password wisely — News of breach or leakage of user data from social network often attracts headlines. Users should be wary of such possibilities and must know how to safeguard themselves and their accounts. The minimum one can do is to have a strong password and change it frequently, and never share personal credentials like username and password with others.
  2. Know who you befriend — Social networking sites usually encourage connecting with users (making friends), sometime even those we don't know or have never met. However, we need to be careful while befriending unknown people as their intentions could possibly be malicious.
  3. Beware of fake information — Fake news, messages and posts are common in social networks. As a user, we should be aware of them and be able to figure out whether a news, message or post is genuine or fake. Thus, we should not blindly believe in everything that we come across on such platforms. We should apply our knowledge and experience to validate such news, message or post.
  4. Think before uploading — We can upload almost anything on social network. However, remember that once uploaded, it is always there in the remote server even if we delete the files. Hence, we need to be cautious while uploading or sending sensitive or confidential files which have a bearing on our privacy.
  5. Privacy matters — Regularly check our privacy settings on social media and always think before posting because it spreads all over the internet.
PrevNext