Class 11 Computer Science (Society Law and Ethics)

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 19

CLASS 11COMPUTER SCIENCE (PYTHON)

SOCIETY, LAW AND ETHIC

1. What is Cyber safety ?


It refers to the safe and responsible use of internet to ensure safety and security of personal
information and not posing threat to anyone else’s information.
2. Identity Protection :
Protection against theft of personal information over Cyber Space without consent, usually
for financial gain is known as Identity Protection.
3. What is Identity Theft ?
Identity Theft is a type of fraud that involves using someone else’s identity to steal money or
gain other benefits. Online identity theft refers to an act of stealing someone’s personal
information such as name, login details etc. and then posing as that person online.
Practices to ensure confidentiality of information:-
(1) use firewall wherever possible
(2) control browser settings to block tracking
(3) browse privately wherever possible
(4) be careful while posting on internet
(5) ensure safe sites while entering crucial information
(6) carefully handle emails
(7) do not give sensitive information on wireless networks
(8) avoid using public computers

4. What is Cyber-crime ?
Any criminal offense that is facilitated by, electronic communications or information
systems, including any electronic device, computer, or the internet is referred to as cyber-
crime.
5. What is Cyber Trolls ?
Derogatory messages or comments posted online targeting people are called cyber trolls.

6. What is Cyber Bullying ?


Harassing, demeaning, embarrassing, defaming or intimidating someone using modern
technologies like internet, cell phones, instant messengers, social networks etc., called cyber
bulling.

7. What is Cyber stalking ?


This is a form of online harassment where the victim is exposed to a large number of online
messages and emails.
Usually, these following people know their victims and instead of turning to offline hunting,
they use the internet to track them.
Commonly used Social Networking Sites:-
(i) Facebook
(ii) twitter
(iii) LinkedIn
(iv) Instagram

8. What is Digital Footprint?


A digital footprint is a trail of data you create while using the Internet. It includes the
websites you visit, emails you send, and information you submit to online services. These
are of two types:
i) An active digital footprint is where the user has deliberately shared information about
themselves either by using social media sites or by using websites.
ii) A passive digital footprint is made when information is collected from the user without
the person knowing this is happening.

9. What you should do while using social media ?


(1) Be authentic
(2)Use a disclaimer
(3) Don’t pick fight online
(4) Protect your identity
(5) Don’t use fake names
(6) Respect your audience
(7) Respect other’s sentiments

10. Tips for Safe Web Browsing:


● Common sense-(never respond to spam & disclose personal information).
● Use an antivirus & Firewall-It provide real-time malware protection.
● Create strong passwords
● Mind your downloads -Be sure to review all pre-checked boxes prompted at download &
un-check any extra applications which we don’t want to install.
● Stay updated- Update operating system, Applications & Anti-virus

11. What is Adware?


Adware is software that generates revenue for its developer by automatically generating
online advertisements in the user interface of the software or on a screen presented to the
user during the installation process. The software may generate two types of revenue: one
is for the display of the advertisement and another on a “pay-per-click” basis, if the user
clicks on the advertisement.

12.What is Malware?
Malware, or malicious software, is any program or file that is harmful to a computer user.
Malware includes computer viruses, worms, Trojan horses and spyware. These malicious
programs can perform a variety of functions, including stealing, encrypting or deleting
sensitive data, altering or hijacking core computing functions and monitoring users’
computer activity without their permission.
13.What is Virus?
A computer virus is a type of malicious code or program written to alter the way a computer
operates and that is designed to spread from one computer to another. A virus operates by
inserting or attaching itself to a legitimate program or document that supports macros in
order to execute its code.
14.What is Trojans?
In computing, a Trojan horse is a program that appears harmless, but is, in fact, malicious. A
Trojan can perform unexpected changes to computer settings and unusual activity, even
when the computer is idle.

15.What is E-waste?
Whenever an electronic device covers up its working life, or becomes unusable due to
technological advancements or becomes non-functional, it is not used anymore and comes
under the category of e-waste or electronic waste.

16. What is E-Waste Management?


As the technology is changing day by day, more and more electronic devices are becoming
non-functional and turning into e-waste. Managing such non-functional electronic devices is
termed as e-waste management. It is reusing and recycling of e-waste which is no longer in
use and can be salved for some of its components.
Ways to dispose off e-waste:
● Give Back to Your Electronic Companies and Drop Off Points
● Visit Civic Institutions
● Donating Your Outdated Technology
● Sell Off Your Outdated Technology
● Give Your Electronic Waste to a Certified E-Waste Recycler

17.Explain Information Technology Act, 2000.


Information Technology Act, 2000
The Information Technology Act, 2000 (also known as ITA-2000, or the IT Act) is an Act of
the Indian Parliament notified on 17 October 2000. It is the primary law in India dealing with
cybercrime and electronic commerce.
A major amendment was made in 2008 and now it is called the IT (Amendment) Act 2008.

18. Gender and disability issues while teaching/using computers:


Gender Issues
● Preconceived notions – Notions like “boys are better at technical and girls are good at
humanities.
● Lack of interest
● Lack of motivation
● Lack of role models
● Lack of encouragement in class
● Not girl friendly work culture

These issues can be handled in following ways:


● There should be more initiative program for girls to take computer subject.
● Film and tv censor board should ensure fair representation of female role models in tv or
cinema
● In practical room they should be more helped and assisted.

Disability Issues:
● Unavailability of teaching materials/aids
● Lack of special needs teachers
● Lack of supporting curriculum

Possible Solution for the same:


● Enough teaching aids must be prepared for specially abled students
● Must employ special needs teachers
● Curriculum should be designed with students with specially abled students in mind.

PYTHON LISTS

What is List in Python?


Python Lists
Like strings, lists are a sequence of values. A list is a data type that can be used to store any
type and number of variables and information. The values in the list are called elements or
items or list members.
A list in Python is formed by enclosing the values inside square brackets ([]). Unlike strings,
lists are mutable, i.e., values in a list can be changed or modified and can be accessed using
index value enclosed in square brackets.

Lists are great, but not suitable for every task. There are other data types out there like
arrays, tuples and dictionaries which may be more suitable for certain tasks. First scope out
your problem and then decided which data type fits the best.

Python Lists Syntax

mylist = ["C","C++","Java","Python","PHP"]

The items within the list must be enclosed within square brackets, and each item must be
separated by a comma. Unlike arrays, Lists can store any type of data type as well as store
variables of different datatypes at the same time.
The double quotes are not part of the syntax of the list. They are only necessary if the item
is a string.

List Indexing
You can access the contents of a list by using it’s index. A list is an ordered collection, so the
values can be called in the order in which they were placed inside.

Don’t forget that indexing starts from zero in python. The code below will output “C++”.
mylist = ["C","C++","Java","Python","PHP"]
print(mylist[1])
Output:
C++

Using negative integers will reverse the order of the list. Negative indexing starts from –
mylist = ["C","C++","Java","Python","PHP"]
print(mylist[-2])
Output:
Python

List Manipulation in Python


Selecting a range of items
If you wish to pick up more than just one item in a python list, you can create “slices”. You
can specify a range, by giving the starting and ending number. Everything in between will be
placed into the slice.
Note that the ending number will not be included in this slice.
mylist = ["C","C++","Java","Python","PHP"]
print(mylist[2:5])
Output:
['Java', 'Python', 'PHP']

You don’t nessacerily how to define the starting point, as the default will be 0, or the start of
the list. The semi-colon and ending point must be present though.
mylist = ["C","C++","Java","Python","PHP"]
print(mylist[:3])
Output:
['C', 'C++', 'Java']

It also works the other way around, where you define the start point, and leave out the end
point, while keeping the semi-colon.
mylist = ["C","C++","Java","Python","PHP"]
print(mylist[2:])
Output:
['Java', 'Python', 'PHP']

Updating an Item in a List


Updating an item value in a list is fairly straight forward. Refer to the index where you want
to change the value and then assign a value to it.
mylist = ["C","C++","Java","Python","PHP"]
mylist[2]="Rust"
print(mylist)
Output:
['C', 'C++', 'Rust', 'Python', 'PHP']

Adding an Item to a List

The append() adds an item to the end of the list.


mylist = ["C","C++","Java","Python","PHP"]
mylist.append("Rust")
print(mylist)
Output:
['C', 'C++', 'Java', 'Python', 'PHP', 'Rust']

The insert() function takes two parameters. The first is the position you want to add a value,
and the second parameter is the value itself.
mylist = ["C","C++","Java","Python","PHP"]
mylist.insert(2,"Rust")
print(mylist)

Output:
['C', 'C++', 'Rust', 'Java', 'Python', 'PHP']
Note that the former second position item, “java” was moved forward to the third position.

Removing an Item from a List


The remove() function removes a specific item from a list.

mylist = ["C","C++","Java","Python","PHP"]
mylist.remove("C++")
print(mylist)
Output:
['C', 'Java', 'Python', 'PHP']
Unlike remove(), the pop() function takes an index as a parameter, and removes the item at
that index. However, the pop function is also often used without any parameters, in which
case, it will remove the last item.
mylist = ["C","C++","Java","Python","PHP"]
mylist.pop(0)
print(mylist)
Output:
['C++', 'Java', 'Python', 'PHP']

Pop() function without any parameters.


mylist = ["C","C++","Java","Python","PHP"]
mylist.pop()
print(mylist)
Output:
['C', 'C++', 'Java', 'Python']

The del() function has two functions. Like, the pop() function it can delete an item at a
specific index, as well as delete a whole list in one go.
mylist = ["C","C++","Java","Python","PHP"]
del mylist

You can delete the value at a specific index using the del keyword in the following manner.
mylist = ["C","C++","Java","Python","PHP"]
del mylist[2]
print(mylist)
Output:
['C', 'C++', 'Python', 'PHP']
Other Useful Operations

To check for a specific item in a list


mylist = ["C","C++","Java","Python","PHP"]
if "C" in mylist:
print("Yes")
Output:
Yes

Finding the length of a list


mylist = ["C","C++","Java","Python","PHP"]
length = len(mylist)
print(length)

Output:
5

Iterating through a list.


mylist = ["C","C++","Java","Python","PHP"]
for x in mylist:
print(x)
Output:
C
C++
Java
Python
PHP
Sorting a list
Using the sort function you can sort a list in ascending order. Works on both alphabets and
numbers. Be careful as this function alters the list itself.
mylist = [1,3,2,6,7,9,8,15,11]
mylist.sort()
print(mylist)
Output:
[1, 2, 3, 6, 7, 8, 9, 11, 15]

Concatenating two lists:


mylist1 = [1,3,2,6]
mylist2 = ["apple", "banana"]
mylist=mylist1+mylist2
print(mylist)

[1, 3, 2, 6, 'apple', 'banana']

PYTHON OPERATORS

Operator in python
Operators are the constructs which can manipulate the value of operands.
Consider the expression 4 + 5 = 9. Here, 4 and 5 are called operands and + is called operator.

Operator Description Example

a+b=
+ Addition Adds values on either side of the operator.
30

a–b=-
– Subtraction Subtracts right hand operand from left hand operand.
10

* a*b=
Multiplies values on either side of the operator
Multiplication 200

/ Division Divides left hand operand by right hand operand b/a=2

% Modulus Divides left hand operand by right hand operand and returns remainder b%a=
0

a**b
=10 to
** Exponent Performs exponential (power) calculation on operators the
power
20

9//2 = 4
and
9.0//2.0
Floor Division – The division of operands where the result is the quotient in which the
= 4.0, -
// digits after the decimal point are removed. But if one of the operands is negative, the
11//3 =
result is floored, i.e., rounded away from zero (towards negative infinity) −
-4, -
11.0//3
= -4.0

Types of Operator
Python language supports the following types of operators.
 Arithmetic Operators
 Comparison (Relational) Operators
 Assignment Operators
 Logical Operators
 Bitwise Operators
 Membership Operators
 Identity Operators
Let us have a look on all operators one by one.
Python Arithmetic Operators
Assume variable a holds 10 and variable b holds 20, then
Python Comparison Operators

Operator Description Example

(a == b)
== If the values of two operands are equal, then the condition becomes true. is not
true.
(a != b) is
!= If values of two operands are not equal, then condition becomes true.
true.

(a <> b)
is true.
This is
<> If values of two operands are not equal, then condition becomes true.
similar to
!=
operator.

If the value of left operand is greater than the value of right operand, then condition becomes (a > b) is
>
true. not true.

If the value of left operand is less than the value of right operand, then condition becomes (a < b) is
<
true. true.

(a >= b)
If the value of left operand is greater than or equal to the value of right operand, then
>= is not
condition becomes true.
true.

If the value of left operand is less than or equal to the value of right operand, then condition (a <= b)
<=
becomes true. is true.

These operators compare the values on either sides of them and decide the relation among
them. They are also called Relational operators.
Assume variable a holds 10 and variable b holds 20, then −

Operator Description Example

c=a+b
assigns
= Assigns values from right side operands to left side operand
value of a
+ b into c

c += a is
equivalent
+= Add AND It adds right operand to the left operand and assign the result to left operand
to c = c +
a

-= Subtract AND It subtracts right operand from the left operand and assign the result to left operand c -= a is
equivalent
to c = c –
a

c *= a is
equivalent
*= Multiply AND It multiplies right operand with the left operand and assign the result to left operand
to c = c *
a

c /= a is
/= Divide AND It divides left operand with the right operand and assign the result to left operand equivalent
to c = c / a

c %= a is
equivalent
%= Modulus AND It takes modulus using two operands and assign the result to left operand
to c = c %
a

c **= a is
**= Exponent Performs exponential (power) calculation on operators and assign value to the left equivalent
AND operand to c = c **
a

c //= a is
equivalent
//= Floor Division It performs floor division on operators and assign value to the left operand
to c = c //
a

Python Assignment Operators


Assume variable a holds 10 and variable b holds 20, then −

Python Bitwise Operators


Bitwise operator works on bits and performs bit by bit operation. Assume if a = 60; and b =
13; Now in the binary format their values will be 0011 1100 and 0000 1101 respectively.
Following table lists out the bitwise operators supported by Python language with an
example each in those, we use the above two variables (a and b) as operands −
a = 0011 1100
b = 0000 1101
—————–
Operator Description Example

(a & b)
& Binary AND Operator copies a bit to the result if it exists in both operands (means
0000 1100)

(a | b) = 61
| Binary OR It copies a bit if it exists in either operand. (means
0011 1101)

(a ^ b) = 49
^ Binary XOR It copies the bit if it is set in one operand but not both. (means
0011 0001)

(~a ) = -61
(means
1100 0011
in 2’s
~ Binary Ones
It is unary and has the effect of ‘flipping’ bits. complement
Complement
form due to
a signed
binary
number.

a << 2 = 240
The left operands value is moved left by the number of bits specified by the
<< Binary Left Shift (means
right operand.
1111 0000)

a >> 2 = 15
The left operands value is moved right by the number of bits specified by
>> Binary Right Shift (means
the right operand.
0000 1111)

a&b = 0000 1100


a|b = 0011 1101
a^b = 0011 0001
~a = 1100 0011
There are following Bitwise operators supported by Python language.

Python Logical Operators


There are following logical operators supported by Python language. Assume variable a
holds 10 and variable b holds 20 then

Operator Description Example

and Logical
If both the operands are true then condition becomes true. (a and b) is true.
AND
Operator Description Example
or Logical OR If any of the two operands are non-zero then condition becomes true. (a or b) is true.
x in y, here
not Logical NOT Used to reverse the logical state of its operand. Not(a and b) is false.
in results
in a 1 if x is
In Evaluates to true if it finds a variable in the specified sequence and false otherwise. a member
of
sequence
y.

x not in y,
here not in
results in a
1 if x is not
not in Evaluates to true if it does not finds a variable in the specified sequence and false otherwise. a member
of
sequence
y.

Python Membership Operators


Python’s membership operators test for membership in a sequence, such as strings, lists, or
tuples. There are two membership operators as explained below −

Python Identity Operators

Operator Description Example

x is y,
Evaluates to true if the variables on either side of the operator point to the same object here is results
Is
and false otherwise. in 1 if id(x)
equals id(y).
x is not y,
here is
Evaluates to false if the variables on either side of the operator point to the same object not results in
is not
and true otherwise. 1 if id(x) is
not equal to
id(y).

Identity operators compare the memory locations of two objects. There are two Identity
operators explained below −

Python Operators Precedence


Sr.No. Operator & Description

**
1
Exponentiation (raise to the power)

~+–
2
Complement, unary plus and minus (method names for the last two are +@ and -@)

* / % //
3 Multiply, divide, modulo and floor division

+–
4
Addition and subtraction

>> <<
5
Right and left bitwise shift

&
6
Bitwise ‘AND’

^|
7
Bitwise exclusive `OR’ and regular `OR’

<= < > >=


8
Comparison operators

<> == !=
9
Equality operators

= %= /= //= -= += *= **=
10
Assignment operators

is is not
11
Identity operators

in not in
12
Membership operators

not or and
13
Logical operators
The following table lists all operators from highest precedence to lowest.

You might also like