English

Science (English Medium) Class 12 - CBSE Important Questions for Computer Science (Python)

Advertisements
[object Object]
[object Object]
Subjects
Popular subjects
Topics
Advertisements
Advertisements
Computer Science (Python)
< prev  21 to 40 of 84  next > 

Write the definition of a Python function named LongLines() which reads the contents of a text file named 'LINES.TXT' and displays those lines from the file which have at least 10 words in it. For example, if the content of 'LINES.TXT' is as follows: 

Once upon a time, there was a woodcutter
He lived in a little house in a beautiful, green wood.
One day, he was merrily chopping some wood.
He saw a little girl skipping through the woods, whistling happily.
The girl was followed by a big gray wolf. 

Then the function should display output as:

He lived in a little house in a beautiful, green wood.
He saw a little girl skipping through the woods, whistling happily.

Appears in 1 question paper
Chapter: [2] File Handling in Python
Concept: Reading from a Text File in Python

Write a function count_Dwords() in Python to count the words ending with a digit in a text file "Details.txt".

Example:
If the file content is as follows:
On seat2 V1P1 will sit and
On seat1 VVIP2 will be sitting
The output will be:
The number of words ending with a digit is 4

Appears in 1 question paper
Chapter: [2] File Handling in Python
Concept: Reading from a Text File in Python

Write one difference between CSV and text files.

Appears in 1 question paper
Chapter: [2] File Handling in Python
Concept: Types of Files in Python

Which of the following functions changes the position of file pointer and returns its new position?

Appears in 1 question paper
Chapter: [2] File Handling in Python
Concept: Setting Offsets in a File in python

Write a function, lenWords(STRING), that takes a string as an argument and returns a tuple containing length of each word of a string.
For example, if the string is "Come let us have some fun", the tuple will have (4, 3, 2, 4, 4, 3)

Appears in 1 question paper
Chapter: [2] File Handling in Python
Concept: Reading from a Text File in Python

Write a function in Python to read a text file, Alpha.txt and displays those lines which begin with the word ‘You’.

Appears in 1 question paper
Chapter: [2] File Handling in Python
Concept: Reading from a Text File in Python

Write a function, vowelCount() in Python that counts and displays the number of vowels in the text file named Poem.txt.

Appears in 1 question paper
Chapter: [2] File Handling in Python
Concept: Reading from a Text File in Python

Consider a file, SPORT.DAT, containing records of the following structure:

[SportName, TeamName, No_Players]

Write a function, copyData(), that reads contents from the file SPORT.DAT and copies the records with Sport name as “Basket Ball” to the file named BASKET.DAT. The function should return the total number of records copied to the file BASKET.DAT.

Appears in 1 question paper
Chapter: [2] File Handling in Python
Concept: The Pickle Module in Python

A Binary file, CINEMA.DAT has the following structure:

{MNO:[MNAME, MTYPE]}

Where

  • MNO - Movie Number
  • MNAME - Movie Name
  • MTYPE is Movie Type

Write a user defined function, findType(mtype), that accepts mtype as parameter and displays all the records from the binary file CINEMA.DAT, that have the value of Movie Type as mtype.

Appears in 1 question paper
Chapter: [2] File Handling in Python
Concept: The Pickle Module in Python

How are text files different from binary files?

Appears in 1 question paper
Chapter: [2] File Handling in Python
Concept: Types of Files in Python

Explain the use of ‘Foreign Key’ in a Relational Database Management System. Give example to support your answer.

Appears in 1 question paper
Chapter: [8] Database Concepts
Concept: Keys in a Relational Database

Explain the concept of “Alternate Key” in a Relational Database Management System with an appropriate example.

Appears in 1 question paper
Chapter: [8] Database Concepts
Concept: Keys in a Relational Database

The school has asked their estate manager Mr Rahul to maintain the data of all the labs in a table LAB. Rahul has created a table and entered data from 5 labs.

LAB NO LAB_NAME INCNCHARGE CAPACITY FLOOR
L001 CHEMISTRY Daisy 20 I
L002 BIOLOGY Venky 20 II
L003 MATH Preeti 15 I
L004 LANGUAGE Daisy 36 III
L005 COMPUTER Mary 37 II

Based on the data given above answer the following questions:

(i) Identify the columns which can be considered as Candidate keys.

(ii) Write the degree and cardinality of the table.

(iii) Write the statements to:

      (a) Insert a new row with appropriate data.

      (b) Increase the capacity of all the labs by 10 students which are on
           the 'I' Floor.

                                     OR

(iii) Write the statements to:

        (a) Add a constraints PRIMARY KEY to the column LABNO in the table.

        (b) Delete the table LAB.

Appears in 1 question paper
Chapter: [8] Database Concepts
Concept: Keys in a Relational Database

Which of the following statements is FALSE about keys in a relational database?

Appears in 1 question paper
Chapter: [8] Database Concepts
Concept: Keys in a Relational Database

Give one difference between alternate key and candidate key.

Appears in 1 question paper
Chapter: [8] Database Concepts
Concept: Keys in a Relational Database

______ command is used to remove the primary key from a table in SQL.

Appears in 1 question paper
Chapter: [9] Structured Query Language (SQL)
Concept: SQL for Data Definition

Which of the following commands will delete the table from the MYSQL database?

Appears in 1 question paper
Chapter: [9] Structured Query Language (SQL)
Concept: SQL for Data Definition

______ is a non-key attribute, whose values are derived from the primary key of some other table.

Appears in 1 question paper
Chapter: [9] Structured Query Language (SQL)
Concept: SQL for Data Definition

Which function is used to display the total number of records from a table in a database?

Appears in 1 question paper
Chapter: [9] Structured Query Language (SQL)
Concept: Functions in SQL

To establish a connection between Python and SQL databases, connect() is used. Which of the following arguments may not necessarily be given while calling connect()?

Appears in 1 question paper
Chapter: [9] Structured Query Language (SQL)
Concept: SQL for Data Definition
< prev  21 to 40 of 84  next > 
Advertisements
Advertisements
CBSE Science (English Medium) Class 12 Important Questions
Important Questions for CBSE Science (English Medium) Class 12 Biology
Important Questions for CBSE Science (English Medium) Class 12 Chemistry
Important Questions for CBSE Science (English Medium) Class 12 Computer Science (C++)
Important Questions for CBSE Science (English Medium) Class 12 Computer Science (Python)
Important Questions for CBSE Science (English Medium) Class 12 English Core
Important Questions for CBSE Science (English Medium) Class 12 English Elective - NCERT
Important Questions for CBSE Science (English Medium) Class 12 Entrepreneurship
Important Questions for CBSE Science (English Medium) Class 12 Geography
Important Questions for CBSE Science (English Medium) Class 12 Hindi (Core)
Important Questions for CBSE Science (English Medium) Class 12 Hindi (Elective)
Important Questions for CBSE Science (English Medium) Class 12 History
Important Questions for CBSE Science (English Medium) Class 12 Informatics Practices
Important Questions for CBSE Science (English Medium) Class 12 Mathematics
Important Questions for CBSE Science (English Medium) Class 12 Physical Education
Important Questions for CBSE Science (English Medium) Class 12 Physics
Important Questions for CBSE Science (English Medium) Class 12 Political Science
Important Questions for CBSE Science (English Medium) Class 12 Psychology
Important Questions for CBSE Science (English Medium) Class 12 Sanskrit (Core)
Important Questions for CBSE Science (English Medium) Class 12 Sociology
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×