Professional Documents
Culture Documents
Manas Comp File Final
Manas Comp File Final
PYTHON
two integers.
20 WORKSHEET 3 15/06/2020
22
Write a program to read a list of n
integers (positive as well as
negative). Create two new lists,
one having all positive numbers
and the other having all negative
numbers from the given list. Print
all three lists
25 Pattern I,II,III
27 PROJECT
28
29
30
∞ TO CALCULATE BMI AND PRINT
NUTRITIONAL STATUS
PROGRAM THAT INPUTS A STUDENTS
MARKS AND PRINTS THE PERCENTAGE
MARKS AND GRADE
TO DISPLAY EVEN AND ODD FROM LIST OF
10 NUMBERS
TO FIND LARGEST AMOUNG ALL THREE
NO.S
TO FIND LOWEST AMOUNG THREE NO.S
TO PRINT THE ROOTS OF QUADRATIC
EQUATION ax2+bx+c=0(a≠0)
TO CALCULATE THE FACTORIAL OF AN
INTEGER USING WHILE LOOP
PROGRAM TO CHECK WHETHER THE
GIVEN NO. IS PALINDROME OR NOT
TO PRINT THE FIBONACCI SERIES i.e. 0 1 1 2
3 5……… TILL N NO.S
PROGRAM TO ADD THE ODD NO.S UPTO
GIVEN VALUE N AND PRINT THE RESULTS
COMPUTE THE GREATEST COMMON
DIVISOR AND THE LEAST COMMON
MULTIPLE OF TWO INTEGERS
DISPLAY THE SUM OF NATUIRAL NO. BTW 1
TO 7.PRINT THE SUM PROGRESSIVELY
TEST IF A NO. IS ARMSTRONG’S NO.
PROGRAM TO OBTAIN x,y AND z from the
user and calculate the value of 4x4+3y3+9z+6π
Program to obtain sum of series
PROGRAM TO INPUT A NO. AND PRINT ITS
SQUARE IF IT IS ODD OTHERWISE PRINT
ITS SQUARE ROOT IF EVEN
CONVERTING TEMPERATURE FROM
CELSIUS TO FAHRENHEIT
Worksheet 3
ANS:- The error is that the decimal literal cannot start with 0.
1
4 What is the difference between else clause of if-else and else clause of
Python loop? Give programming examples to elaborate. 2
ANS:- The else of an if/else signifies the start of a code block which will only
execute if the conditional (after the if results in a False value.
The else after loops signify the start of a code block which is executed only when
the loop executes fully - i.e. there is no break, or return or anything else executed
within the loop.The else after a try/except signifies the start of a code block, which
is only executed if there is no exception raised within the try block.
Eg. x=10
If x>12:
print(x)
else :
print(x)
AND
For i in range (1,30,1)
If i ==3:
break
5 Ask the user to enter a temperature in Celsius. Write a program in Python which
should print a message based on the temperature: 3
(i) if the temperature is less than -273.15 print that the temperature is invalid
because it is
below
absolute
zero :
6 Two objects (say a and b) when compared using ==, return True. But Python gives
False when compared using is operator. Why (i.e, a == b is True but why is a is b
False?) 2
ANS:- The above happens because a==b means that the value of a is equal to b.
But, it does not mean that a is equal to b as they are distinct variables of a python
program and have different memory locations .
ANS”: We know that the division operator always returns float value .Therefore
there is no difference in the above values as the answer will be float type even if
the operands are integers. 2
Continue statement
This statement is used to skip over the execution part of the loop on a certain
condition. After that, it transfers the control to the beginning of the loop.
Pass statement
As the name suggests pass statement simply does nothing. We use pass
statement to write empty loops. Pass is also used for empty control statements,
functions and classes.
PROJECT
A 9-person crime, was registered under Sections 65, 66, 66A, C and D of
the Information
Technology Act, along with Sections 419 and 420 of the Indian Penal
Code. Under the
complaint of this cyber fraud case in India, a company representative in the
business of trading
and distribution of petrochemicals in India and abroad had filed the report
against the 9 accused
of using a similar looking website to carry
on the trade.
The accused ran a defamation campaign against the company, causing them
crores of rupees of
loss from their customers, suppliers and
even producers.
1 Advances in technology are the primary driver for economic growth but have
also led to a higher incidence of cyber-attacks. Comment .
ANS:
Our society, economy, and critical infrastructures have become largely dependent on
computer networks and information technology solutions. Cyber attacks become more
attractive and potentially more disastrous as our dependence on information technology
increases.
Cyber attacks are more common because cyber attacks are cheaper, convenient and
less risky than physical attacks . Cyber criminals only require a few expenses beyond a
computer and an Internet connection. They are unconstrained by geography and
distance. They are difficult to identity and prosecute due to anonymous nature of the
Internet. Given that attacks against information technology systems are very attractive, it
is expected that the number and sophistication of cyber attacks will keep growing.It is
very clear that advances in technology and many pros and cons which include cyber
crimes.
2 What are different types of
cybercrimes?
Ans: Common forms of cybercrime include:
Phishing: using fake email messages to get personal information from internet
users;
Misusing personal information (identity theft);
Hacking: shutting down or misusing websites or computer networks;
Spreading hate and inciting terrorism
Cyberstalking: online harassment where the user is subjected to a plethora of
online messages and emails.
Identity theft:when a criminal gains access to a user’s personal information to
steal funds, access confidential information, or participate in tax or health
insurance fraud
4. Why it is advisable to check the security of the website before you enter personal and
credit
card information while shopping?
Your credit card isn't safe anywhere, especially the internet. When you're shopping
online with your credit card, it's important to follow some guidelines to avoid credit card
fraud and identity theft. It is advisable to check the security of the website before you
enter personal and credit
card information while shopping because if you don't so you could be a victim of
cybercrime.
Checking the websites security will assure us that no one can access our card details
and that we have a safe transaction online.We should avoid clicking on email links,
particularly in unsolicited emails, because these links could take you to a fake website
that's set up for the sole purpose of stealing your credit card information.
5. What are the usage rules while using social media?
Ans:- RULES TO USE WHILE USING SOCIAL MEDIA:-
1. Use a strong password. The longer it is, the more secure it will be.
2. Use a different password for each of your social media accounts.
3. Set up your security answers. This option is available for most social media
sites.
4. If you have social media apps on your phone, be sure to password protect your
device.
5. Be selective with friend requests. If you don’t know the person, don’t accept their
request. It could be a fake account.
SOURCE CODE:
OUTPUT
TUPLE FUNCTIONS:
TO FIND THE POSITION OF THE MINIMUM
AND MAXIMUM ELEMENT
SOURCE CODE
OUTPUT:
TO CHECK IF THE ELEMENT WITH MAXIMUM
VALUE LIES IN THE FIRST HALF OF SERIES
OR THE SECOND HALF
SOURCE CODE
OUTPUT
PATTERN TYPE I
SOURCE CODE:
OUTPUT:
OUTPUT:
OUTPUT:
To ask user for valid phone no. of format aaa-
bbb-ccc
Source code:
OUTPUT:
PROJECT
Write a menu driven program having the following options
(use functions and appropriate data types):
Open a savings bank account
• Deposit money
• Withdraw money