Advertisements
Advertisements
List and briefly explain different modes of malware distribution.
Concept: undefined >> undefined
List some common signs of malware infection.
Concept: undefined >> undefined
Advertisements
List some preventive measures against malware infection.
Concept: undefined >> undefined
What are the main components of data communication?
Concept: undefined >> undefined
Assertion (A): CSV (Comma Separated Values) is a file format for data storage that looks like a text file.
Reason (R): The information is organized with one record on each line and each field is separated by a comma.
Concept: undefined >> undefined
Atharva is a Python programmer working on a program to find and return the maximum value from the list. The code written below has syntactical errors. Rewrite the correct code and underline the corrections made.
def max_num (L):
max=L(O)
for a in L:
if a > max
max=a
return maxConcept: undefined >> undefined
Differentiate between CHAR and VARCHAR data types in SQL with appropriate examples.
Concept: undefined >> undefined
Write one difference between CSV and text files.
Concept: undefined >> undefined
In a table in the MYSQL database, an attribute A of datatype varchar(20) has the value “Keshav”. The attribute B of datatype char(20) has the value “Meenakshi”. How many characters are occupied by attribute A and attribute B?
Concept: undefined >> undefined
The code given below accepts a number as an argument and returns the reverse number. Observe the following code carefully and rewrite it after removing all syntax and logical errors. Underline all the corrections made.
define revNumber (num) :
rev = 0
rem = 0
While num > 0:
rem ==num %10
rev = rev*10 + rem
num = num//10
return rev
print (revNumber (1234))Concept: undefined >> undefined
Kabir wants to write a program in Python to insert the following record in the table named Student in MYSQL database,
SCHOOL:
- rno(Roll number) - integer
- name(Name) - string
- DOB (Date of birth) - Date
- Fee - float
Note the following to establish connectivity between Python and MySQL:
- Username - root
- Password - tiger
- Host - localhost
The values of fields rno, name, DOB and fee has to be accepted from the user. Help Kabir to write the program in Python.
Concept: undefined >> undefined
Zack is working in a database named SPORT, in which he has created a table named “Sports” containing columns SportId, SportName, no_of_players, and category.
After creating the table, he realized that the attribute, category has to be deleted from the table and a new attribute TypeSport of data type string has to be added. This attribute TypeSport cannot be left blank. Help Zack write the commands to complete both the tasks.
Concept: undefined >> undefined
How are text files different from binary files?
Concept: undefined >> undefined
Sartaj has created a table named Student in MYSQL database, SCHOOL:
- rno(Roll number )- integer
- name(Name) - string
- DOB (Date of birth) – Date
- Fee – float
Note the following to establish connectivity between Python and MySQL:
- Username - root
- Password - tiger
- Host - localhost
Sartaj, now wants to display the records of students whose fee is more than 5000. Help Sartaj to write the program in Python.
Concept: undefined >> undefined
Consider the code given below and fill in the blanks.
print (" Learning Exceptions…")
try:
num1 = int(input ("Enter the first number")
num2 = int(input("Enter the second number"))
quotient=(num1/num2)
print ("Both the numbers entered were correct")
except ________: # to enter only integers
print (" Please enter only numbers")
except __________: # Denominator should not be zero
print(" Number 2 should not be zero")
else:
print(" Great .. you are a good programmer")
___________________ : # to be executed at the end
print(" JOB OVER… GO GET SOME REST")Concept: undefined >> undefined
Write the use and syntax for the following method:
open()
Concept: undefined >> undefined
Write a command(s) to write the following lines to the text file named hello.txt. Assume that the file is opened in append mode.
“ Welcome my class”
“It is a fun place”
“You will learn and play”
Concept: undefined >> undefined
Write a Python program to open the file hello.txt used below in read mode to display its contents. What will be the difference if the file was opened in write mode instead of append mode?
“ Welcome my class”
“It is a fun place”
“You will learn and play”
Concept: undefined >> undefined
Write a program to accept string/sentences from the user till the user enters “END” to. Save the data in a text file and then display only those sentences which begin with an uppercase alphabet.
Concept: undefined >> undefined
All the branches of XYZ school conducted an aptitude test for all the students in the age group 14 - 16. There were a total of n students. The marks of n students are stored in a list. Write a program using a user defined function that accepts a list of marks as an argument and calculates the ‘xth’ percentile (where x is any number between 0 and 100).You are required to perform the following steps to be able to calculate the ‘xth’ percentile.
Note: Percentile is a measure of relative performance i.e. It is calculated based on a candidate’s performance with respect to others. For example: If a candidate's score is in the 90th percentile, that means she/he scored better than 90% of people who took the test.
Steps to calculate the xth percentile:
I. Order all the values in the data set from smallest to largest using Selection Sort. In general any of the sorting methods can be used.
II. Calculate index by multiplying x percent by the total number of values, n.
For example: to find 90th percentile for 120 students: 0.90*120 = 108
III. Ensure that the index is a whole number by using math.round()
IV. Display the value at the index obtained in Step 3.
The corresponding value in the list is the xth percentile.
Concept: undefined >> undefined
