Q1: Multiple Choice Questions:
1. _________refers
to the layout pattern in which various computers are connected to one another
to form a network.
a. Protocol b.
Topologies c. Hub d.
MODEM
2. _______provides
the location and mechanism (protocol) to access the resource.
a. URI b.
HTTP c. URL d.
WWW 3
3. ____________
is a document on the WWW that is viewed in a web browser.
a. Web
Page b. Word Document c. Slide d. Sheet
4.
A ____
is a computer network that connects multiple local area networks (LAN) in a
limited geographical area.
a. LAN b. WAN c.
PAN d. CAN
5.
______
is a Network Device that stays in extension slot of motherboard.
a. Hub b. NIC c. Repeater d. Switch
6. Information
Technology Act, 2000 (India) comes into existence in INDIA on
a. 17th
October 2000 b. 27th November 2003 c. 1st January 2006 d. 17th October 2009
7. How E-waste results
in data theft?
a.By Email Forwarding
b. By Replacing Old Electronic Device in Exchange without
clearing data.
c.By Sharing Data d. By using Wi-fi Network.
8.
Plagiarism means _________________
a.An Act of presenting another person’s work or idea as your
own. b.A disease that
affects humans and other mammals. c.A
contagious bacterial disease characterized by fever. d.None of Above.
9.
Computer Vandalism ___________________
a.Action involving deliberate
destruction of or damage to property. b.Malicious
action that involves the destruction of computers and data. c.An action to protect computer from
virus. d.None of Above.
10.On
which toll free number a complaint can be registered with Punjab Police Cyber
Crime Division in case of any online fraud??
a. 1911 b. 1930 c. 1947 d. 1912
11.Which
Act in India focuses on Cyber Crime?
a.
Banking Regulation Act 1949 b. IT Act
2000 c.
Indian Penal Code 1860 d. CrPC 1973
12. We can define a collection of different facts
representing any quality as:
a. Information b. Data c. DBMS d. MySQL
13.Which
person or group of persons is responsible for administrating the database?
a. End User b.
Application Programmer c.
DBA d. None of These
14.Primary
Key refers to a column or a set of columns to identify all records_____.
a.
Uniquely b. Correct Spelled c. Linked to another table d. All of above.
15. ______ Key is used
to establish relationships between two available tables.
a. Candidate Key b. Primary Key c. Super Key
d. Foreign Key
16.Which
one is an example of DML Command.
a. INSERT
b. SELECT c.
UPDATE d. All of These
17.____________
is the process of designing, developing, testing, and maintaining software.
a.Software b. Software Engineering c. Prototype d. Program
18. Wrapping up the data and functions of an object into a single
unit is known as ___________
a.
Abstraction b.
Encapsulation c. Testing d. Design Patterns
19. ___________
verifies that the software meets its requirements and is free of bugs.
a. Reusability b.
Testing c. Efficiency d. Modularity
20.
Proper __________ is required for the successful software development
process.
a.
planning and execution b.
creation c. software d. knowledge
21.
_________ is a type of document that specifies all those things that need to be
defined and created during the entire project cycle.
a.
SRS b. SDLC c. RRS
d. SDD
22. ___________ is a
software dedicated to software development.
a. Editor b.
Compiler c. Interpreter d. IDE
23.__________
is a program which translates our code into machine language and then executes
it line by line.
a. Compiler b. Interpreter c. IDE
d. All of these
24.Any
program consists of ___________.
a.
Keywords b. Identifiers c. Tokens d. Operators
25.
____________
are the names given to program elements, such as variable, function, class,
list, tuples, etc. for their identification.
a.
Keywords b. Identifiers c. Tokens d.
Operators
26.
__________
are those identifiers which are used to store values and they allows us to
change their value during runtime.
a.
Variables b. Constants c. Lists d.
Operators
27.A
___________ is basically a text that gives an explanation about the program
code. Compilers and interpreters ignore these comments and do not execute them.
a. Comment
b. Coding c. Indentation
d. Editor
28.
To create a block of codes in Python, we use ___________
a. Curly Brackets b. Square Brackets c. Line Indentation d. Line Numbering
29. ___________
specify the type of data that can be stored inside a variable.
a. Type Conversion b.
Data-type c. Operand d. Expression
30.__________
data type is used to represent the truth value of an expression.
a. Boolean b. Float c. Integer d. Complex
31.________is
an unordered sequence of data items in the form of key-value pair.
a. Set b. List c.
Dictionary d. Tuple
32.______
types are those types whose contents are allowed to be changed after the
creation.
a. Mutable b. Immutable c.
Standard d. Built-in
33.Valid
combination of operators and operands is called _____________
a. Variables b.
Constants c. Expression d. Conversion
34._______
is the process of converting data of one type to another type.
a.
Data Type b. Mutable c. Indentation d. Type
conversion
35. In this type of
execution flow, the statements are executed one after the other sequentially.
a. Branching b.
Looping c. Sequential d. All of these
36.Looping
Flow Control is also known as _________ Flow Control.
a.
Branching b. Iterative c. Sequential d. Decision-Making
37.
Python
provides us some such statements that can be used to control the execution flow
within theloops. Such statements are known as __________ Statements.
a.Sequential b. Decision-Making c. Loop
Control d. Branching
38.The
________ Statement in Python is used to skip the current iteration and continue
with the next iteration.
a.if else b. while c.
continue d. break
39.We
use_________ statement in Python to write empty loops.
a.break b. continue c. fail d. pass
40.A __________
loop is a loop inside a loop.
a.
Outer b. Inner
c. Nested d. Empty
40. String is a data
structure in Python that represents a sequence of ________ characters.
a. Alphabets b.
ASCII c. Unicode d. None of these
41.String
is an ___________data type in Python, i.e. once we created a string, we cannot
change it.
a. Static b.
Dynamic c. Mutable d. Immutable
42.A
___________ value can be written using single, double or triple quotes in
Python.
a.
Numeric b. Boolean c. String d. Real
43.Concatenation
means joining two or more strings. In Python, we can join (concatenate) two or
morestrings using the ________ operator.
a.* b. + c. ++ d.
**
44.______
operators are used to test whether the specific value (single-character or
string) is present (as a part/member) in the given string.
a.Indexing b. Slicing c.
Identity d. Membership
45.______
is a function that can be called (used) to calculate the length of specified
string (as aparameter).
a.count() b. len() c. length() d. string()
46._______
method splits a string into a list of substrings
a.slice() b. divide() c. join() d. split()
47.To access an item of the list by its index we need to use __________
brackets.
a.Curley { } b.
Parenthesis ( ) c. Square
[ ] d. None of these
48.___________
a list means to access each item (value) stored in the list for doing something
with the items.
a.Traversing b. Indexing c. Slicing d. Processing
49. The
___________ is a function that can be called to calculate the length of List.
Length is calculated interms of number of items in the List
a. length() b.
count() c. len() d. None of these
50.________
means arrange the values in ascending or descending order.
a.
Index b. Slice c. Sort d. Traverse
51. If we want to add an item at the
_____________ of the current list, we can use append() method.
a. beginning b. end c. mid d.
All of the these
52.Tuple
creation is also known as _____________.
a.
Tuple Packing b. Tuple Unpacking c. Tuple Formation d. None of the Above
53.To
delete key-value pair from the dictionary, we can use __________function of the
dictionary
a.
remove() b. clear() c.
drop() d. del()
Que:2
Fill in the blanks:
1.________
function is used to find the total of all values in an expression.
Answer:- SUM
2.__________
keyword can be used to sum only the distinct values of expression.
Answer:-
DISTINCT
3.__________
arguments can be there in LEFT Function in MySQL.
Answer:-
Two
4. _________
command of MySQL can be used to see the structure of a table.
Answer:-
DESC
5. COUNT()
is an example of _________ type of functions.
Answer:-
Aggregate
7.______is
a network of interconnected devices that are capable of exchanging data over a
network.
Answer:-IOT
8. In ______
topology, all the computers are connected to a central computer or a central
node.
Answer:-Star
9.________
is an electrical cable with a conductor at its centre.
Answer:-Coaxial
Cable
10.__________
is a service that allows us to put a website or a web page onto the Internet.
Answer:-Web
Hosting
11.___________ allows us to have
voice call (telephone service) over the Internet.
Answer:-VOIP
12.________ are
small pieces of information the website can store in the user browser.
Answer:-Cookies
13._______ refers to the code of
responsible behaviour on the internet.
Answer:-Cyber Ethics
14.______ is a type of malware
(malicious software) that locks a victim’s data or device.
Answer:-Ransomware
15. _______ is an act of secretly or
stealthily listening to the private conversation of others without their
consent in order to gather some important or secret information.
Answer:-Eavesdroping
16.______ is a type of malicious
action that involves the destruction of computers and data in different ways
and certainly disrupting businesses.
Answer:-Computer vandalism
17._______ help you maintain your
privacy by encrypting the data and internet requests before forwarding them to
the internet.
Answer:-VPN
18.________
function is used to find the total of all values in an expression.
Answer:-SUM
19._________
keyword can be used to sum only the distinct values of expression.
Answer:-DISTINCT
20._________
arguments can be there in LEFT Function in MySQL.
Answer:-Two
21._________
command of MySQL can be used to see the structure of a table.
Answer:-DESC
22.COUNT()
is an example of _________ type of functions.
Answer:-Aggregate
23.A well-written
document acts as a tool and means to provide ____________ necessary for
software processes, functions and maintenance.
Answer:-Information
24.Engineering is
all about developing products, using well-defined methods and ___________.
Answer:-Scientific
Principles
25.A __________
may include activities that are part of the software process.
Answer:-Process
Model
26.A ____________ is an early version
of a product and from these prototypes future versions are developed.
Answer:-Prototype
27.The ___________ can be considered
as a generic process model.
Answer:-Classical Waterfall Model
28.____________ is a default editor
that accompanies Python
Answer:-IDLE
29. We can use Python Interpreter in
two modes: _________ and ____________
Answer:-Interactive, script model
30.Keywords are the _________
words.
Answer:-Reserve
31.__________ are the fixed
(constant) values used in a source code.
Answer:-Literals
32._______ are the tokens responsible
to perform an operation in an expression.
Answer:-Operators
33.We can display program data to the
console in Python with _______ function.
Answer:-print()
34. IDE
stands for _______________
Answer:-Integrated
Development Environment
35. Python is a ___________ typed
language. It means we do not need to define the type of the variable while
declaring it.
Answer:-Dynamically
36.Standard data types are also known
as __________ data types.
Answer:-Built-in
37.Floating Numbers are ___________
which are written with a decimal point.
Answer:-Real numbers
38._______ is a data type which is
mainly used when we are using a loop.
Answer:-Range
39.The ___________ keyword is used to
define a null value.
Answer:-None
40.The operators are grouped
hierarchically according to their order of evaluation, known as ________
Answer:-Precedence
41.There are two ways of type
conversions: ____________ and _____________
Answer:-Implicit, Explicit
42._________
refers to the spaces at the beginning of a code line
Answer:-Indentation
43.Conditional
Flow Control is also known as _____________
Answer:-Branching
44.______ Statement is another form
of conditional statement in which we can test multiple conditions
Answer:-if-elif else
45.The ‘for’ loop is also known as __________ loop
Answer:-counting
46.The __________ loop is also called
Conditional loop
Answer:-while
47.The _____________ Statement in
Python brings control out of the loop
Answer:-break
48.Python does not have a __________
data type;
Answer:-Single Character
49.Strings can be accessed directly
using a numeric index or key value (like array in other programming languages).
This process is referred to as ____________.
Answer:-Indexing
50.The symbol ‘*’ is used to denote
the ______________ operator.
Answer:-repetition
51.________ is the process of
obtaining a substring from a string.
Answer:-Slicing
52.A part of
String is called _______________.
Answer:-substring
53.______ method
is used to find a given substring in the string.
Answer:-find()
54.isalnum() method determines whether the string consists of
____________ characters.
Answer:-Alphanumeric
55.List is an ordered and ___________
collection of one or more data items, not necessarily of the same type; they
can be of any type.
Answer:-mutable
56.Lists respond to all of the
general sequence operations: concatenation, repetition, membership and
____________.
Answer:-slicing
57.The _____________ method reverses
the current order of the elements in the list.
Answer:-reverse()
58.In
Python, we can also create lists of lists, known as ________.
Answer:-Nested Lists
59.A Tuple is similar to a List, but
we create them with ________ instead of square brackets.
Answer:-parenthesis
60.The main difference between List
and Tuple is that a tuple is ______ while the list is _______
Answer:-immutable, mutable
61.___________ is also known as Tuple
Unpacking.
Answer:-Tuple Assignment
62.The _______ method is used to
remove all the elements (key-value pairs) from the dictionary.
Answer:-clear()
Q3: Write the Full Forms:
i. LAN Local Area
Network
ii. MAN Metropolitan
Area Network
iii. CAN Campus Area
Network
iv. WAN Wide Area
Network
v. PAN Personal Area
Network
vi. STP Shielded
Twisted Pair
vii. UTP Unshielded
Twisted Pair
viii. MODEM Modulator
Demodulator
ix. NIC Network
Interface Card
x. DSL Digital
Subscriber Line
xi. TCP Transmission
Control Protocol
xii. IP Internet
Protocol
xiii. UDP User
Datagram Protocol
xiv. POP Post Office
Protocol
xv. SMTP Simple Mail Transfer Protocol
xvi. FTP File Transfer Protocol
xvii. HTTP HyperText Transfer Protocol
xviii. HTTPS HyperText Transfer Protocol Secure
xix. ARP Address Resolution Protocol
xx. RDP Remote Desktop Protocol
xxi. IMAP Internet Message Access Protocol
xxii. PPP Point to Point Protocol
xxiii. VoIP Voice over Internet Protocol
xxiv. WWW World Wide Web
xxv. IoT Internet of Things
xxvi SRS Software
Requirement Specification
xxvii DDS Design
Document Specification
xxviii SDD Software Design Document
xxix SDLC Software
Development Life Cycle
Que: 3 Write True or False
i)
CIA triad stands for Confidentiality, Integrity, and
Availability. True
ii)
IT Act in India came into force in the year 1995. False
iii)
E-waste is good for human health. False
iv)
Cyber Ethics ensure that users understand their
responsibilities for conducting themselves online. True
v)
Ethical Hacking is used to expose vulnerabilities in systems.
True
vi)
Spying is an act of keeping a secret watch on various
activities of opponents for intelligence purposes. True
Que: 4 Short Answer Type Questions:
Que: 1 Describe
Cyber Crime.
Ans: Cyber
Crime is an unlawful act wherein the computer is either a tool or a target or
both. These crimes involve the use of technology to commit fraud, identity
theft, data breaches, computer viruses, scams, and other malicious acts. A
person who uses his skills in technology to do such malicious acts and illegal
activities is called Cyber-Criminal.
Que: 2 What do you
mean by Hacking?
Ans:
Hacking refers to the misuse of electronic devices such as Computers,
Smartphones, Tablets, and Networks. It is associated with illegal activity and
data theft by Cyber Criminals. Cyber Criminal uses various software to break
into a person’s computer and the person may not be knowing that his computer is
being accessed from a remote location. A person who breaks into a computer
system is called Hacker.
Que: 3 Define
Phishing and explain various ways to protect from phishing.
Ans:
Phishing is a common type of cyber-attack that targets individuals through
email, messages, and phone calls. It attempts to steal our money or identity,
by getting us to reveal personal information such as bank information, or
passwords etc. Following are some common ways to protect oneself from
Phishing:
a.
Protect your computer by using security software
b.
Protect your cell phone by setting software to update
automatically
c.
Protect your accounts by using multi-factor authentication
d.
Protect your data by backing it up.
Que: 4 What is
Ransomware? Mention various types of Ransomware.
Ans:
Ransomware is a type of malware (malicious software) that locks a victim’s data
or device and threatens to keep it locked unless the victim pays a ransom to
the attacker. There are two general types of Ransomwares: a.Encrypting
Ransomware or Crypto Ransomware
b.Non-Encrypting Ransomware or Screen-Locking Ransomware
Que: 5 Explain CIA Triad.
Ans: In
cyber security, CIA simply means: Confidentiality, Integrity and Availability.
It’s also referred as the CIA Triad. It is a common model that forms the basis
for the development of security systems. They are used for finding
vulnerabilities and methods for creating solutions.
Que: 6 What is
Firewall?
Ans:
Firewall is a Network Security System. It is a hardware or software whose main
function is to protect the network from unauthorized access. A firewall
monitors both incoming as well as outgoing network traffic data and traps the
illegal ones. Most of the operating system comes with a firewall installed. So
we should always turn on firewall to protect our system.
Que: 7 What is
Cyberbullying?
Ans:
Cyberbullying is a form of bullying or harassment. It takes place over digital
devices like cell phones, computers, and tablets. Cyberbullying includes
sending, posting, or sharing negative, harmful, false, or mean content about
someone else. Cyberbullying can occur through SMS, Text, and apps, or online in
social media, & forums, or where people can share contents.
Que: 8 What do you
mean by Plagiarism?
Ans:
Plagiarism is an act of presenting another person’s work or idea as your own
work. This crime happens when a person disobeys copyrights and downloads music,
movies, games, and software etc. There are so many laws that stop people from
illegal downloading of music, movies etc.
Que: 9 Explain
Identity Theft.
Ans:
Identity Theft also called Identity Fraud. Identity theft happens when someone
steals your personal information to commit fraud such as making unauthorized
transactions or purchases. Cyber criminals commit identity theft by using
cyber-attack tactics, including social engineering, phishing, and malware etc.
Que: 10 How to
browse internet safely?
Ans:
Following are some of the guidelines to browse internet safely:
•
Use antivirus software to deal internet threats such as a
computer virus etc.
•
Use Anti-spywares to detect and remove unwanted spyware
programs
•
Never download or install software from untrusted source to
keep our system safe from Trojan horses.
•
Login only from the official websites and don’t follow
unknown links to protect yourself from the Phishing.
•
Use Firewalls to protect the network from unauthorized
access.
•
Always use a different range of passwords for different
websites
Que: 11 Describe
the various harmful effects of E-Waste.
Ans: When
the E-waste is not disposed of properly, it harms the environment and people.
Below are some of the common harmful effects of E-waste:
•
When the e-waste is disposed informally, it releases fine
dust particles or toxic gases that cause air pollution
•
When the e-waste is disposed in regular land openly, then it
contaminates the soil and the underlying water.
•
E-waste also causes water pollution because these wastes
generally contains mercury, lead etc. which contaminate the water
•
E-waste contains toxic materials like mercury, lead, etc.
that cause harmful effects on the health of humans.
Que:12. Define DBMS.
Ans: DBMS
Stands for Database Management System. Such systems fall in the category of
System Software. DBMS acts as an interface between end-users and a database.
DBMS provides an environment that allows users to create, read, update, and
delete data in the database. It also provides features such as data security,
data integrity etc.
Que:13
Explain the role of DBA in Database.
Ans: DBA
stands for Database Administrator. DBA can be a person or a group of persons.
These users are responsible for maintaining and administrating the database.
Key-functions of a DBA are:
•
They are responsible to look after its usage. They decided
who can use the database. • They provide
support to users
•
They are responsible to define security and integrity checks
for database
•
They design Backup and Recovery strategies
•
They Monitors the performance of database on regular basis
Que;14
What do you mean by Record Based Logical Models?
Ans: Record
Based Logical Model is a type of Data Model. This Model specifies the overall
logical structure of the database. In this model, database is structured in
fixed format records. Each record type defines a number of fields or
attributes. The most commonly used Record Based Data Models are:
1.The Hierarchical Model
2. The Network
Model
3.The Relational Model
Que: 15.
What is domain and degree in a relation?
Ans:Domain: It
refers to the collection of all accepted values for an attribute of the
relation. For Example, {“Male”, ”Female”} can be considered as a domain for the
field named Gender.
Degree: Total
no of attributes/columns present in a relation/table is called the degree of
the relation. Degree of a table can be denoted by d(R). For example: if a table
has three columns, then its degree d(R) will be 3.
Que:16. Define the
importance of database KEYs.
Ans: We use
keys in the database environment. These keys are used for defining various
types of integrity constraints in a database. A table represents a collection
of the various related records. So, there might be thousands of records, and
some of these might even be duplicated. Thus, we need a way in which we can
identify all of these records uniquely. Such type of issues can be resolved
with the help of keys. Primary Key, Foreign Keys are the most common type of
keys used in the database environment.
Que17. What do you
mean by Normalization?
Ans:
Normalization is a database design technique that reduces data redundancy. It
eliminates undesirable characteristics like Insertion, Update and Deletion
Anomalies. Normalization rules divides larger tables into smaller tables and
links them using relationships.
Que:18. Explain
numeric data types with example.
Ans: Numeric
data types are used to represent numeric values in a database. Following are
some of the commonly used numeric data types with example:
•
Boolean: It is
used only for the true and false condition. Zero is considered as false,
non-zero values are considered as true.
•
Int or
Integer: It is used to represent integer values (values without any
fraction). Values of these types can be signed or unsigned, For example: -25,
+47, 125 etc.
•
Float
and Double: These types are used to represent approximate numeric
values. Double provides higher precision than Float. These types are suitable
for scientific calculations.
•
Dec or
Decimal:These types are used to represent an exact fixed-point
number. It is Ideal for financial calculations, for example: +25.50, -99.850
etc.
Que:19What
is MySQL?
Ans: MySQL
is a fast and easy-to-use Relational Database Management System (RDBMS). It is
being used for many small and big businesses. MySQL is developed and supported
by MySQL AB, which is a Swedish company. It uses a standard form of the
well-known SQL data language. MySQL follows the working of ClientServer
Architecture.
Que:20
Write the name of any 8 String functions used in MySQL.
Ans: String
functions are used to process data in text format. Commonly used functions are:
1.
CONCAT 5.LEFT 9.REVERSE
2.
INSERT 6.SUBSTRING
10.RIGHT
3.
LCASE 7.REPEAT
4.
UCASE 8.REPLACE
Que:21What
are aggregate functions? Give the name of any two aggregate functions.
Ans:
Aggregate functions are used to perform calculations on multiple values and
return the result in a single value - like average of all values, sum of all
values, get maximum & minimum value among certain groups of values etc.
Aggregate functions are mostly used with SELECT statement in MySQL Some of
commonly used aggregate functions are: COUNT, SUM, AVG, MAX, MIN etc.
Que:22
Explain the difference between File processing and Database.
Ans: File
based systems were traditional systems for storage of facts in manual system.
In this type of storage, data processing specialist creates the necessary
computer file structures for each user separately. Each user manages his/her
own data in their separate files within specified structures. Data Specialist
then design some application programs that create reports based on file data.
On the other hand, a Database approach represents a
well-organized collection of data which can be accessed by different users but
stored only once in a system. All it is done with the help of DBMS systems. The
various operations performed by the DBMS system are: Insertion, deletion,
selection, sorting etc.
Ques: 23 What is Python?
Ans: Python
is a popular programming language. It was developed by Guido van Rossum, and
released in 1991. It is further developed by the Python Software Foundation. It
is a general-purpose high-level programming language. It supports Object
Oriented programming approach to develop applications. It is becoming ever more
popular for data science.
Que:24. Write the
name of any four application areas of Python.
Ans:
Following are the common application areas of Python:
i.
Developing Games iv. Business
Applications
ii.
Web Development v. Audio
and Video-based Applications
iii.
Artificial Intelligence (AI) & Machine Learning (ML) vi. CAD Applications
Que:25.
What is IDE? Write some examples of IDEs used for Python.
Ans: An IDE
(or Integrated Development Environment) is a software dedicated to software
development. It offers computer programmers with extensive software development
abilities. The Python Shell or IDLE
(Integrated Development and Learning Environment) is a
default editor that accompanies Python. PyCharm, Visual Studio Code, Sublime,
Jupyter Notebook, etc. are the commonly used third party IDEs used for Python.
Que:26. What do
you know about Python Shell?
Ans: The
Python Shell or IDLE (Integrated Development and Learning Environment) is a
default editor that accompanies Python. This IDE is suitable for beginner level
developers. It is provided free of cost. Writing Python code using IDLE is
great for simple things, but it becomes difficult to handle larger programming
projects using IDLE.
Que:27. What are
Keywords?
Ans:
Keywords are the reserve words. They have special meaning and their meaning
can’t be changed. Most of the keywords usually consists of lowercase letters
only. We cannot use keywords as regular identifiers. Common examples of
keywords are: if, else, elif, while, for, true, false etc. To view the list of
python keywords, we can use the python statements: keyword.kwlist
Que:28. Write the
various naming rules for identifiers.
Ans: For
defining the name of program elements, we have to follow the naming rules:
•
The identifier consists of a combination of lowercase (a-z)
or uppercase (A-Z) alphabets or numbers (09) or underscore (_).
•
The Identifier cannot start with a digit.
•
Any keyword cannot be used as identifier name.
•
Symbols or Special characters, other than underscore (_)
cannot be used in the identifier.
•
Python is a case sensitive language.
•
Whitespaces are strictly prohibited in an identifier.
Que:29. What are
Operators?
Ans: These
are the tokens responsible to perform an operation in an expression. For these
tokens, we use special symbols and characters, such as +, *, >, <, and,
or, in, is etc., that carry arithmetic, logical etc. operations on operands.
The variables or values on which operation is performed are called operands.
Que:30. Explain
the concept of variables in Python.
Ans:
Variables are those identifiers which are used to store values and they allows
us to change their value during runtime. There is no specific command in python
to declare a variable. In Python, a variable is created the moment a value is
assigned to it. Based on the data type of the value assigned to a variable, the
interpreter allocates memory to the variable. For example: x = 12
Que:31. What is
the role of comments in Programs?
Ans:
Comments are the integral part of a program. A comment is basically a text that
gives an explanation about the program code. A comment makes the code simpler
to understand. Comments make it easy for the programmer to remember the complex
things added to the code. Comments can be used to explain the working of a
particular block of code.
Que32. How can you
add blank lines in the output of Python programs?
Ans: A line
containing only whitespace is known as a blank line. There are three ways to
print blank lines:
1.
The first and simplest way is to use a blank print statement,
i.e. print().
2.
The second way is to put empty single or double quotation
marks in the print statement, i.e. print(‘’) 3.The third way is to use a newline character in print
statement, i.e. print(‘\n’)
Que:33 What is Data Type?
Ans:
Data-Type specifies the type of data stored in the variable. Generally, we use
integer, string and real type values to store in the variables. Python is a
dynamically typed language. This means we don't need to define the type of a
variable while declaring it. The interpreter automatically binds the data type
to the variable according to the value assigned to it.
Que:34. Write the
name of some Standard Data types used in Python.
Ans:
Standard data types are also known as Built-in data types. These data types are
built into the Python interpreter. Some of the common data types defined in
Python are:
•
Numeric • Set
•
Boolean • Mapping
•
Sequence • None
Que35. What do you
know about the set data type of Python?
Ans: A set
is an unordered collection of elements. To define the elements of a set, we
have to write the comma separated values in the curly brackets. For Example:
{10, 20, 30 ,40, 50}. Duplicate values in the set will be ignored. Because, the
items in a set list are unordered, so it will appear in random order.
Que36. What are
Operators?
Ans: These
are the tokens responsible to perform an operation in an expression. For these
tokens, we use special symbols and characters, such as +, *, >, <, and,
or, in, is etc., that carry arithmetic, logical etc. operations on operands.
The variables or values on which operation is performed are called operands.
Consider the example: 3+4. Here, + is the operator and 3, 4 are the operands on
which + operator perform its operation.
Ques 37. What are
Operands?
Ans: An
operator alone cannot perform any operation. It needs one or more operands to
perform its operation. The variables or values on which operators perform their
operation are performed are called operands. Consider the example: 3+4. Here, +
is the operator and 3, 4 are the operands on which + operator perform its
operation.
Ques
38 Explain the concept of Expression.
Ans: A
valid combination of operators and operands is called an Expression. It is like
a formula in mathematics. Whenever, we perform some operation on
values/operands, we get a new value (also called result of operation). Consider
the example: 3+4 is an expression which consists of + operator and 3, 4
operands. After completion of + operation, it will produce a result 7.
Ques 39 Explain
the various Arithmetic operators used in Python.
Ans:Following
table shows the Arithmetic Operators along with their operations and suitable
example:
Operator Symbol |
Description of Operator |
Example |
+ |
Addition |
5 + 10 = 15 |
- |
Subtraction |
5 – 10 = -5 |
* |
Multiplication |
5 * 10 = 50 |
/ |
Real Division |
19 / 5 = 3.8 |
// |
Integer Division |
19 // 5 = 4 |
% |
Modulus (for Remainder) |
19 % 5 = 4 |
** |
Exponent |
5 ** 2
= 25 |
Ques
40 What are Identity Operators of Python?
Ans:Identity
operators are used to compare its operands. During comparison, it checks:
•
If left and right operands are equal?
•
If left and right operands are same object?
•
If left and right operands have the same memory
location?
After comparison, these operators return either True or False
value. There are two Identity operators in Python: ‘is’ and ‘is not’.
Ques 41. What is
Type Conversion?
Ans: In
programming, type conversion is the process of converting data of one type to
another type. For example: conversion of integer value to string, conversion of
float value into integer value etc. Operands that differ in type may undergo
type conversion before the expression takes on its final value. There are two
ways of type conversions:
1.
Implicit (Automatic) Conversion
2.
Explicit (Type Casting) Conversion
Ques42. What are Strings?
Ans: String
is a sequence of Unicode characters. A single character is also considered as a
String in Python. A string value can be written using single, double or triple
quotes in Python. For Example: ‘Hello', “Hello", ‘‘‘Hello’’’. String is an
immutable data type in Python, i.e. once we created a string, we cannot change
it. Strings are frequently used for the data (such as student name etc.) that
can be represented as a text.
Ques 43. What do
you mean by Indexing in Python?
Ans: In
Python, strings are ordered sequences of character data. They can be accessed
directly using a numeric index or key value. This process is referred to as
Indexing. String indexing in Python is zero-based: the first character in the
string has index 0, the next has index 1, and so on. Following figure shows the
indexing of strings in Python:
H |
E |
L |
L |
O |
|
P |
Y |
T |
H |
O |
N |
0 1 2
3 4 5 6 7
8 9 10 11 str
-12 -11
-10 -9
-8 -7
-6 -5
-4 -3
-2 -1
Ques 44
Write the name of four String Operators.
Ans: Some
of the common String operators are:
1.
Concatenation Operator (+) 3.Membership
Operators (is, is not)
2.
Repetition Operator (*) 4.Slicing
Operator ([m:n])
Ques 45 What is
Slicing?
Ans:
Slicing is the process of obtaining a substring from a string. Python provides index-based syntax to extract
a substring from a string. Slicing creates a new substring from the source
string and original string remains unchanged. Slicing in a String is done by
using a Slicing operator (colon). For Example:
str="Hello Python"
print(str[6:8]) //it will show
Py
Ques
46 Write the name of four string methods used for case conversion in Python?
Ans:
Following string methods are commonly used for Case Conversion in Python:
1.
capitalize("hello python") - Convert the string into Hello python
2.
title("hello python") - Convert the string into Hello Python
3.
lower("HELLO Python") - Convert the string into hello python
4.
upper("hello python") - Convert
the string into HELLO PYTHON
Ques
47 Explain string len() function with suitable example.
Ans:len()
stands for length function which can be used to calculate the length of
specified string. Length is calculated in terms of number of characters in the
string. It returns a numeric value after calculating the length of the given
string. Consider the following:
len(“Hello
Python”) - will return 12 as the length of the string
Ques
48 Explain find() method with suitable example.
Ans: find()
method is used to find a given substring in the string. We can use this method
to check if a Python string contains a particular substring. It returns the
lowest index in string where given substring is found. If the specified
substring is not found, it returns -1. For Example: if str="Hello
Python", then
str.find("Py") - will return 6 because index of Py
begins from index 6
Ques 49 Explain
isalnum() method with suitable example.
Ans:isalnum()
method determines whether the string consists of alphanumeric characters. This
method returns True if string is non-empty and all its characters are
alphanumeric (either a alphabet or a number), otherwise it will return False
value. For Example: if str1="Hello
Python 123" and str2="Hello@Python",
then str1.isalnum( ) - will return True because str1 has alphabets
and numbers only str2.isalnum(
) - will return False because str2 has
special character @
Ques 50. What is
the use of strip() method with strings?
Ans: This
method is used to trim (removes) both the leading and trailing characters
(based on the string argument passed in the method) from the string. This
method returns a copy of string after removing the characters from the left and
right ends of the string. For Example: if str="abcabcab",
then
str.strip("ab") - will
return cabc
Ques 51. Which
method is used to concatenate strings in Python?
Ans: join()
method is used to concatenate strings from an iterable (list, string, tuple,
etc.). This method returns a string by joining all the elements of an iterable,
separated by the given separator. For Example:
mylist=["C",
"Java", "Python"] separator="-"
separator.join(mylist) - will return
"C-Java-Python"
Ques
52 What do you mean by Traversing?
Ans:
Traversing a list means to access each item (value) stored in the sequence for
doing something with the items. Traversing is also sometimes called iterating
over any sequence like lists, tuples etc. There are various ways for traversing
sequences in Python. Usually, we use for loop to traverse sequences.
Ques
53 Write about the four basic List Operations with suitable examples.
Ans: Four
basic list operations with suitable examples are shown below:
Let the
lists be: mylist1 = [11, 12,
23, 75, 47, 79] mylist2
= [3, 4]
Operation |
Expression |
Result |
Concatenation |
mylist1 + mylist2 |
[11, 12, 23, 75, 47, 79, 3, 4] |
Repetition |
mylist2*3 |
[3, 4, 3, 4] |
Membership |
3 in mylist1 |
False |
Slicing |
Mylist1[2:5] |
[23, 75, 47] |
Ques
54 How will you calculate the length of a List in Python?
Ans: len()
function can be used to calculate the length of List. Length is calculated in
terms of number of items in the List. It returns a numeric value after
calculating the length of the given List. Consider the following example:
Let the list
be: mylist
= [29, 47, 174, 1977] len(mylist) #It will return 4 as a length of
List
Ques
55 How will you sort the elements of List/Tuple in Python?
Ans: Sort
means arrange the values in ascending or descending order. The sorted()
function can be used to sort items of a list/tuple. This function sorts the
list by creating a new sorted list/tuple; without making any changes to the
original list. Strings are sorted alphabetically, and numbers are sorted
numerically. We cannot sort a list that contains both string values and numeric
values. The default order of sorting is ascending order. To sort the list in
descending order, we have to use the keyword argument reverse = True.
Ques
56 What are Nested Lists? Give Example.
Ans: In Python, we can
also create lists of lists, known as Nested Lists. Lists within the lists are
called sub-lists. Following example shows the concept of nested lists: |
|
|
mylist1=[29, 15, 47] mylist2=[79, “Hello”, 90] nested_list1=[mylist1, mylist2] #A list having two lists mylist1&mylist2print(nested_list1) #shows [ [29, 15, 47], [79, “Hello”, 90]] |
Ques
57What are Tuples?
Ans: A
Tuple is similar to a List, but we create them with parentheses instead of
square brackets. A Tuple is also an ordered collection of one or more data
items, not necessarily of the same type. All the items are separated with
comma. For Example:
mytuple = (12,
5.6, 29, “Hello”)
A tuple can have duplicate values as well. The main
difference between List and Tuple is that a tuple is immutable while the list
is mutable.
Ques
58 What do you mean by Tuple Packing?
Ans: Tuple
creation is also known as Tuple Packing.
We can create a tuple in various ways by using different types of elements.
Following are some examples of Tuple Packing:
mytuple1 = (22, 33, 5, 23) #Tuple
with integers as elements mytuple2 = ('hi', 11, 45.7) #Tuple with mixed data type
Ques 59 Explain the
concept of Tuple Unpacking.
Ans: Tuple
Assignment is also known as Tuple
Unpacking. It is a process that assigns tuple values on the right-hand side
of assignment operator (=) to the variables on the left-hand side. In
unpacking, we basically extract the values of the tuple into single variables.
Consider the following example: (num1, num2, num3) = (45, 67, 90)
In this tuple assignment, values of tuple (45, 67, 90) are
unpacked and assigned to variables num1, num2, and num3 respectively, i.e.
num1=45, num2=67 and num3=90
Ques
60 How will you access the items of a Dictionary?
Ans: We
can access the items of a dictionary by referring to its key name, inside
square brackets: Consider the following example:
Let the Dictionary is:
dict1={'Name': 'Param', 'Age':
20, 'Gender': 'Male'}
print(dict1[‘Name’]) #shows Param as the
value of ‘Name’ key
Q5: Long Answer Type Questions:
1. Explain
Different types of Networks in detail.
Ans: Networks
can be classified into various types based on the geographical area covered by
them. Some of the common types are explained below:
1.
PAN: PAN
stands for Personal Area Network. It is a computer network organised around a
person. It is used for communication between devices such as phones, and
laptops that are in close proximity.
2.
LAN: LAN
stands for Local Area Network. These networks are limited to a local area such
as a school or an office building.
3.
CAN: CAN
stands for Campus Area Network. This type of network connects multiple LANs in
a limited geographical area. A CAN is smaller than a WAN or MAN. It can be set
up by a college or a company.
4.
MAN: MAN
stands for Metropolitan Area Network. This type of network usually covers a
larger area than a LAN. For example, a network that connects two offices in a
city is considered as a MAN
5.
WAN: WAN
stands for Wide Area Network. Such networks span a wider geographical area. A
WAN may be spread across cities, countries and continents.
2. Explain Types
of Network Topologies.
Ans:
Topology refers to the layout pattern in which various computers are connected
to one another to form a network. There are five main types of topologies. They
are:
1.
Bus
Topology: In bus topology, all the computers are connected to a
single cable called the bus. The transmission of data from any computer travels
through this bus in both the directions.
2.
Ring
Topology:In ring topology, each computer is connected to two other
computers so as to form a closed ring-like structure. In this topology, data is
transmitted in one direction only.
3.
Star
Topology: In star topology, all the computers are connected to a
central computer or a central node. The data to be exchanged between any two
computers passes through the central node.
4.
Mesh
Topology:In mesh topology, every computer is connected to every other
computer on the network. Full mesh topology is very expensive to implement.
Normally, partial mesh topology is implemented in which a computer is connected
to a few other computers in the network.
5.
Tree
Topology:A Tree topology is a type of network topology that resembles
a tree. In a tree topology, there is one central node (the “trunk”), and each
node is connected to the central node through a single path. A tree topology is
also known as a star bus topology.
3.
What is Twisted Pair Cable? Explain its types.
Ans:
Twisted Pair Cable is a Wired Transmission Media used for Networking. It is a
type of Guided Media. It consists of a pair of insulated wires twisted
together. Twisted pair cabling comes in two varieties:
1.
Unshielded
Twisted Pair (UTP):UTP cable has four pairs or eight colour-coded copper wires
twisted together and covered with a plastic sheath. Their electromagnetic
interference gets cancelled due to the twisting effect. UTP cables are
primarily used in LANs.
2.
Shielded
Twisted Pair (STP):STP cable uses the techniques of wire twisting, shielding,
and cancellation. Each pair of wires is covered in a metallic foil. Then four
pairs of wires are covered by an external metallic braid. STP cables reduce
crosstalk.
4. Explain any
three Unguided media in detail.
Ans: Wireless
media used for transmission of data in a network is known as Unguided Media. In
wireless networks, data is transmitted without wires. Three commonly used
Unguided medias are:
1.
Bluetooth
Technology:This wireless technology is used for exchanging data over
short distances using radio waves. This technology is commonly used to transfer
songs or pictures between mobile phones.
2.
Wi-Fi
Technology:Wi-Fi stands for Wireless Fidelity. This technology also
makes use of radio waves to transmit and receive data. This technology has
faster rate of transmission.
3.
Infrared:
Infrared waves cannot penetrate walls or other obstructions. So, there should
be no physical barrier between the communicating devices using infrared. The
communication between a TV set and its remote happens through infrared waves.
5. What is MODEM?
Briefly Explain any two external MODEMS.
Ans: MODEM
is the most common hardware device used in Computer Networks. It consists of two
words MO (Modulator) and DEM (DEModulator). When modem converts digital signal
into analog signal, It is called Modulation. Similarly, when modem converts
analog signal into digital signal, It is called as Demodulation. There are two
types of Modems: Internal and External Modems. External Modems are further of
many types.
Types of External Modem:
i.
Telephone
Modem: A computer is connected through telephone lines to access
the network of other computers. It is cheaper when compared to other modems.
ii.
Digital
Subscriber Line (DSL): It provides high speed internet connection through telephone
lines. It is expensive when compared to a telephone modem. In DSL, voice
communication and internet service can be used simultaneously.
6. What is Hub?
Explain its types.
Ans: To
establish a Local Area Network, we need a central device, called Hub, which
connects all the computers of a network. Hub is a switching processor.
Types of Hub:According
to working functionality, there are two types of hub:
1.
Active
Hub: The hub which increases the value of signal and remove
unnecessary signal is called active hub. Sometimes, this type of hub is called
intelligent hub.
2.
Passive
Hub: Passive hub doesn’t increase the value of signal. Passive
hub only helps to exchange information from computer to computer.
7. What is Network
Protocol? Explain any five commonly used protocols.
Ans:
Network Protocol refers to a set of rules used by computers on a network to
communicate with each other. Some examples of protocols are:
1.
Transmission
Control Protocol (TCP):It is a popular communication protocol. It divides message
into series of packets that are sent from source to destination and there these
packets are reassembled to create original message.
2.
Post
Office Protocol (POP):This protocol is designed for receiving incoming E-mails.
3.
Simple
Mail Transport Protocol (SMTP): It is designed to send and distribute
outgoing E-Mails.
4.
File
Transfer Protocol (FTP):FTP allows users to transfer files from one machine to
another.
5.
Hyper
Text Transfer Protocol (HTTP):It is a protocol used between a web
server and a web browser for transferring HTML pages.
8. Briefly explain
the concept of WWW.
Ans: The
World Wide Web (WWW) or web in short, is an ocean of information, stored in the
form of trillions of interlinked web pages and web resources. Tim Berners-Lee -
a British computer scientist invented the revolutionary World Wide Web in 1990
by defining four fundamental technologies:
1.
HTML: Hyper
Text Mark-up Language or HTML is a language which is used to design Web Pages
2.
URI: Uniform
Resource Identifier is a unique identifier to identify a resource located on
the web
3.
URL:
Uniform Resource Locator provides the location and mechanism (protocol) to
access the resource.
4.
HTTP: The
Hyper Text Transfer Protocol is a set of rules which is used to retrieve linked
web pages across the web. It’s more secure and advanced version is HTTPS.
9. Write the steps
of website hosting.
Ans: Web
hosting is a service that allows us to put a website or a web page onto the
Internet, and make it a part of the World Wide Web. To host a website, follow
the steps given below:
•
Select the web hosting service provider that will provide the
web server space as well as related technologies and services such as database,
bandwidth, etc.
•
Identify a domain name, which best suits our requirement, and
get it registered through domain name Registrar.
•
Once we get web space, create logins with appropriate rights
and note down IP address to manage web space. Upload the files in properly
organised folders on the allocated space.
•
Get domain name mapped to the IP address of the web server.
10. What is Client Server Computing? Write its
characteristics.
Ans: The
client-server model has become one of the central ideas of network computing. A
client-server a technique through which clients access resources and services
from a central computer using network. A server may serve multiple clients at
the same time while a client is in contact with only one server. An example of
a client server computing system is a web server. It returns the web pages to
the clients that requested them.
Characteristics of Client Server Computing:
•
The client server computing works with a system of requests
and responses. The client sends a request to the server and the server responds
as per the request received.
•
The client and server should follow a common communication
protocol so they can easily interact with each other.
•
A server can only accommodate a limited number of client
requests at a time.
11.
What is
IoT? Explain its Characteristics
Ans: The
Internet of Things (IoT) refers to devices connected to the Internet. IoT
(Internet of Things) is a term for networked devices that collect and exchange
data via the Internet using various protocols. Examples of such devices are:
door locks, security cameras, smoke alarms, drones, etc.
Characteristics of IoT:
•
Dynamic
and Self-Adapting: The IoT devices can dynamically adapt with sensed
environment, their operating conditions, and take actions accordingly. For ex:
Surveillance System.
•
Self-Configuring: IoT
devices can be able to upgrade the software with minimal intervention of user,
whenever they are connected to the internet.
•
Interoperable
Communication: IoT allows different devices (different in architecture) to
communicate with each other as well as with different network. For ex: MI Phone
is able to control the smart AC/TV.
•
Unique
Identities: The devices which are connected to the internet have unique
identities i.e. IP address through which they can be identified throughout the
network
•
Integrated
into Information Network: The IoT devices are connected to the network to share some
information with other connected devices.
12. What are
Objectives of Software Engineering? Explain.
Ans:
Following are the common objectives of Software Engineering:
1.
Facilitating maintenance of software – It is the ability of
the software to be modified, repaired, or enhanced easily with changing
requirements.
2.
Develop efficient software –Being efficient usually means
avoiding wastage. The software should not keep busy computing devices such as
memory, processor cycles, etc.
3.
Reusability in Software – It makes sure that the module can
be used in multiple applications.
4.
Develop Reliable Software – It assures that the product will
deliver the same results when used in similar working environment.
5.
Develop Portable Software – Portability of software is the
capacity to use the same software in different platforms. The software can be
transferred from one computer system to another.
13. Explain
Advantages of Software Engineering.
Ans:
Following are some of the common advantages of Software Engineering:
1.
Improved quality: Software can be developed with fewer bugs
and higher reliability by following software engineering principles and
techniques.
2.
Increased productivity: Software Engineering allows
developers to be more productive and complete projects faster.
3.
Better maintainability: Software is easier to maintain and
update over time using software engineering practices.
4.
Reduced costs: Software Engineering can help to reduce the
cost of fixing bugs and adding new features later on.
5.
Increased customer satisfaction: Software engineering can help to increase
customer satisfaction by involving customers in developing software that meets
their needs.
14. Explain
Disadvantages of Software Engineering.
Ans:
Following are some of the common disadvantages of Software Engineering:
1.
High costs: Implementing a systematic approach to software
development requires a significant investment in tools and training.
2.
Complexity: With the increase in the number of tools and
methodologies, software engineering can be complex.
3.
Limited creativity: The focus on structure and process can
restrict creativity and innovation among developers.
4.
High learning curve: The development process can be complex,
and it requires a lot of learning and training.
5.
High maintenance: The software engineering process requires
regular maintenance to ensure that the software is running efficiently, which
can be costly and time-consuming.
15. Explain Stages
of SDLC.
Ans: SDLC
stands for Software Development Life Cycle. It defines various activities to be
performed on a software product from its beginning to retirement. Following are
the stages of SDLC where different activities are performed to develop a
software:
•
Stage-1: Planning and Requirement Analysis: Planning is the
most important step in software development. The requirement analysis is
performed by the Software Engineers.
•
Stage-2: Defining Requirements: In this stage, all the
requirements for the target software are specified in the form of a document
called SRS (Software Requirement Specification).
•
Stage-3: Designing Architecture: In this phase, Software is
designed with the best architecture. Various designs are specified in a
document called DDS (Design Document Specification).
•
Stage-4: Building or Developing Product: In this phase,
actual development of software begins. Developers use a specific programming
language as per the design in DDS for software development.
•
Stage-5: Product Testing and Integration: After the
development of the product, testing of the software is necessary to ensure its
smooth operation.
•
Stage 6: Deployment and Maintenance of Product: After
testing, the product is released and is used in a real industrial environment.
16. Explain
Advantages of the Classical Waterfall Model.
Ans:
Following are some of the major advantages of Classical Waterfall model:
•
Easy to Understand: This Model is very simple and easy to
understand.
•
Individual Processing: Various phases in this model are
processed one at a time.
•
Properly Defined: In this model, each stage is defined
clearly.
•
Clear Milestones: This model has very clear and
well-understood milestones.
•
Properly Documented: Processes, actions, and results are very
well documented.
•
Reinforces Good Habits: Classical Waterfall Model reinforces
good habits like define-before-design and design-before-code.
•
Working: Classical Waterfall Model works well for smaller
projects and projects where requirements are well understood.
17. Explain
Disadvantages of the Classical Waterfall Model.
Ans:
Following are some major drawbacks of Classical Waterfall Model:
•
Difficult to accommodate Change Requests: It is difficult to
accommodate any change requests after the requirements specification phase is
complete.
•
No Overlapping of Phases: This model recommends that a new
phase can start only after the completion of the previous phase. To increase
efficiency and reduce cost, phases should be overlapped.
•
Late Defect Detection: In the Waterfall Model, testing is
typically done toward the end of the development process. This means that
defects may not be discovered until late in the development process, which can
be expensive and time-consuming to fix.
•
Lengthy Development Cycle: The Waterfall Model can result in
a lengthy development cycle, as each phase must be completed before moving on
to the next.
•
Not Suitable for Complex Projects: The Waterfall Model is not
well-suited for complex projects.
18. Explain
applications of the Classical Waterfall Model.
Ans:
Various applications of Classical Waterfall Model are given below:
•
Large-scale Software Development Projects: The Waterfall
Model is often used for large-scale software development projects.
•
Safety-Critical Systems: The Waterfall Model is often used in
the development of safety-critical systems, such as aerospace or medical
systems.
•
Government and Defence Projects: The Waterfall Model is also
commonly used in government and defence projects.
•
Projects with well-defined Requirements: The Waterfall Model
is best suited for projects with welldefined requirements.
•
Projects with Stable Requirements: The Waterfall Model is
also well-suited for projects with stable requirements.
19. What is
Prototyping and where it is used?
Ans:
Prototyping is a type of Software Development Process Model. In this model, a
prototype for proposed system is used to develop the complete software. Here,
prototype represents an early version of a product and from these prototypes
future versions are developed. Prototypes aren't the final product or service.
Following are the applications for the use of Prototyping model:
1.
Prototype model should be used when the desired system needs
to have a lot of interaction with the end users.
2.
Prototype model are best suited in online systems, where web
interfaces have a very high amount of interactions with end-users.
3.
Prototyping ensures that the end users constantly work with
the system and provide a feedback which is incorporated in the prototype to
result in a useable system.
20. What do you
mean by Flow Control Statement? Explain different types of flow control
statements used in Python.
Ans: Flow
control means the order in which the statements or instructions written in the
program get executed. There are three ways in which the statements of a program
will be executed. They are:
1.
Sequential
Flow Control: Sequential Flow Control is the Default Flow Controlin the
programs. By using sequential statements, we can develop simple programs. In
this type of execution flow, the statements are executed one after the other
sequentially.
2.
Conditional
Flow Control: Conditional Flow Control is also known as Branching or
Decision-Making Flow Control. In this type of flow control, statements are
executed based on the condition. If the given condition is evaluated to true
then one set of statements are executed, and if it is false then the other set
of statements will be executed. Conditional statements are used much in complex
programs.
3.
Looping
Flow Control: Looping Flow Control is also known as Iterative or Repetitive
Flow Control. It is used to repeat the execution of statements. It executes
statements repeatedly until the given condition becomes false. Once the
condition becomes false then the execution comes out of that loop.
21. What is
Branching Statement? Explain any one branching statement with suitable Example.
Ans:Conditional
Flow Control is also known as Branching or Decision-Making Flow Control. In
this type of flow control, statements are executed based on the condition. If
the given condition is evaluated to true then one set of statements are
executed, and if it is false then the other set of statements will be executed.
Conditional statements are used much in complex programs.
•if statement:if statement helps us to run a
particular code, but only when a certain condition is satisfied. The condition
gives either True or False result. If the condition result is True, then if-block statements will be executed
but If the condition result is False, then “block of if statements” won’t get
executed. This execution flow can be seen in the flow-graph.
22. What is
Looping? Explain any one looping statement with suitable example.
Ans:
Looping Flow Control is also known as Iterative or Repetitive Flow Control. It
is used to repeat the execution of statements. It executes statements
repeatedly until the given condition becomes false. Once the condition becomes
false then the execution comes out of that loop.
•while loop: The while loop is also called Conditional loop, because in this loop, every time a condition is checked at the beginning of the loop, and if it is true, then the loop’s body gets executed. When the condition became False, the execution flow comes out of the loop. Example:
23. Write a Python
program to find the largest of three numbers.
Ans:Following
is the program and output to find the largest of three numbers:
Program:
Output: Enter
1st Number: 4 Enter 2nd
Number: 7 Enter 3rd
Number: 5 Largest Number
is: 7 |
num1=int(input("Enter
1st Number: ")) num2=int(input("Enter 2nd Number: "))
num3=int(input("Enter 3rd Number: ")) if num1>num2 and
num1>num3:
print("Largest
Number is: ", num1) elif num2>num1 and num2>num3:
print("Largest Number is: ", num2)
else: print("Largest Number is: ", num3)
24. Write a Python
program to find the factorial of a positive number.
Ans:Following
is the program and output to find the factorial of a positive number:
Output: Enter a Positive
Number: 4 Factorial of
the number is: 24 |
Program: num=int(input("Enter
a Positive Number: ")) fact=1
for I in range(num,1,-1)
fact=fact*i
print ("Factorial of the given number is: ",fact)
0 Comments
Post a Comment
Please don't post any spam link in this box.