Skip to main content

Posts

Showing posts from May, 2020

Loops in Python

Loops in Python Loops are used when you have a block of code which you want to repeat a fixed number of times. There are two type of loops in python: While Loop For Loop While Loop While loop in python is also known as pre-tested loop, because it first tests the condition then it allows the statement to execute written under it, until it is true. For Loop A for loop is used for iterating over a sequence (that is either a list, a tuple, a dictionary, a set, or a string). For loop is written with range function. The Range() Function The range is built in function in Python that allows you to generate a series of numbers within a given range. There are three ways you can call range(): Range(stop) Range(start, stop) Range(start, stop, step) Example 1 -  for x in range(5): print(x) Output -  0 1 2 3 4 Example 2 -  for x in range(1, 5): print(x) Output -  0 1 2 3 4 Example 3 - for x in range(1, 10, 2): print(x) Output -  1 ...

Q & A Chapter 1 | Python | Class 10 CBSE | Computer Application

Solutions of Computer Science with Python Class 10 A. Multiple Choice Questions(Tick the correct options) -  1. (d) 2. (c) 3. (b) 4. (a) 5. (b) 6. (b) 7. (c) 8. (a) 9. (a) 10. (a) B. Very short answer type questions - To exit from python editor press ctrl + z from keyboard or exit(). Operators are the symbols which perform the operation on some values. There are two types of operators Unary and Binary Operator. Python is available for free anybody can download and make programs in python. Also you can add or update modules or functions in python library. Tokens are smallest unit of a python program. Python breaks each lines into a sequence of meaningful component. Punctuators are symbols that are used in programming languages to organize sentence structures. The most common punctuators are ' " # C. Short Answers - Escape Sequence is a character that contains a special meaning. There are various types of escape sequence some of them are '\n...

CBSE Class 8 Chapter 2 MS Access

Exercise A. Tick the correct option -  1. (c) AutoNumber 2. (a) Date/Time 3. (b) Primary Key 4. (d) Primary Key 5. (c) Validation Rule 6. (d) Record B. Fill in the blanks -  1. Datasheet 2. Design 3. Rows, Columns 4. Memo 5. Text 6. Required C. True or False 1. False 2. True 3. True 4. True 5. False 6. True D. Differentiate between – 1. Record and Field The rows in a table are known as records. A record stores complete information about an object or an item. The columns in a table are known as fields or attributes. The fields contain only single type of data. Every field has a data type that determines the type of values that can be stored under it. 2. Number and Auto Number data type The number data type accepts number type data whether it can be an integer or a decimal number. The users have to manually input the data in the fields. While Auto number data types are need not to be entered manually, it automatically increment it value when the records are entered. ...

Control Flow Statement in Python

Control Flow Statement in Python A computer always executes a program sequentially. It starts execution from the first statement and ends at the last statement. This order of execution of statement(s) is called Flow of Control . But if you want some statements to print after fulfilling some condition then this can be achieved by using the control flow statement . The control flow statement or control statements are used to control the flow of execution of the program. There are three different types of control flow statements in python: Sequential Decision making or selection Looping or iterative Sequential – Sequential execution of statements is the default behaviour of the program, in which it executes one line after another. Decision Making or Selection – Decision making statement is also called selection statement. Here, the execution of the statements depend upon the condition. Once the condition is fulfilled then the control of the flow will move accordingly....

Working with tables in MS Access

Working with tables in MS Access Views of a table The tables in MS Access have only two views – Design and Datasheet View. Design View In design view of the table, you can enter the field names, their data types and description. The design view window is divided into two parts – Field grid panes and Field property pane. Field grid pane – It is used for entering field names and their data types. You can also give a description to the fields in this pane. This description column is optional. Filed property pane – This section is used to set properties of the fields in the table. Datasheet View Datasheet view is used to enter data in a table. When you double click the table name in the left hand side pane window, it opens the datasheet view of the table. Switching between views Microsoft Access allows you to switch from one view to another by following options: Option 1 – Click on the View Option in the View Group on the Home Tab to change from one view to ...

Escape Sequence

What are Escape Sequence characters? Give example. Escape Sequence is a character that contains a special meaning. Escape Sequence Description \n New line \\ Backslash \’ Single quotation \” Double quotation \a Bell \b Backspace \r Carriage return \t Horizontal tab \v Vertical tab

Table Datatypes in MS Access

Field Data Types The various data types in Microsoft Access are described below in the table: Data Types Description AutoNumber It stores an integer that increments automatically as you add records. Text It is used to store combination of text and numbers that does not require calculations, such as address, mobile number, name, etc. The field of this data can hace a maximum of 255 character. Memo When you have more than 255 characters to enter, then you should use this data types for entering large text. Like detailed description of a student or items or products, etc. Number This data type is used to enter number in the column or fields. Date/Time It stores date and time values. You can display the dates and times in various format. You can change the format from field property menu. Currency This data type stores the currency value. It shows the value in decimal format with $ sign. Yes/No This data type accept only one value Yes/No or Trye/False. ...

Introduction to Microsoft Access

Microsoft Access Microsoft Access is data management software. In this software you can store, retrieve and manipulate data. Microsoft Access is similar to excel but the major difference is that in excel all the column heading is dynamic you can make any new column for entering data and in access before entering any data you have to create the column heading along with its data type. Microsoft access is also called database software. Database means to store the data in an organised manner. The database has four components Table, Query, Forms and Reports. All the data in database are stored in tables. Tables in Access A table is a database object, which is used to store data in an organised manner. It consists of rows and columns. A database can have more than one table. Components of table The important components of a table are: 1. Fields or Attribute – The columns in a table are known as fields or attributes. The fields contain only single type of data. Every field ...

Data types in Python

Data types in Python A data type represents the type of data stored into a variable or memory. There are five main data types : Numeric String List Tuple Dictionary Note – Variables are the address in the memory where the values are stored. We can treat variable like a container where you can put or store something. Numeric Data Type The numeric data types are used to represent numbers. There are three sub data types : int f loat complex Int data type The int data type represents an integer number. An integer number are a number without any decimal point or fraction part. For example 200, -100, 67, 100000, etc. Integer uses 4 bytes to store a value. It can range from -2147483648 to 2147483647. Float data type The float data type represents floating point numbers. A floating point number is a number that contains a decimal point. Like 3.14, 34.45, -45.678, etc. Float uses 8 bytes to store a value. It can range from 2.3E-308 to 1.7E+308. ...

Basic Structure of Python program

BASIC STRUCTURE OF A PYTHON PROGRAM #addition of two number a = 10 b = 20 c = a + b print(c) print(“Addition=“,c) #check greater number between two if a>b:   print(“The value of a is greater”) else:   print(“The value of b is greater”) Output:- 30 Addition=30 The value of b is greater Elements of the Program Comment  – The statement which is starting with # symbol is called comment line. This line is ignored by compiler. Statement  – A statement is an instruction that the python interpreter can execute. Expression  – Expression are the statement which is used for calculation in programming language. E.g. c = a + b is an expression where the addition of a and b is stored in c. Expressions are formed with operators and operands. Block or Suite  – A block or suite are a group of statements in a program like control flow statement and looping statement. Function  – The print() or input() function in pyt...

CBSE Class 8 Chapter 1 Networking

Exercise – A. Tick the correct option – 1. A network in which two or more computers are connected within a small area such as a room is called LAN 2. A network which is organised around a person is known as PAN 3. A computer which provides services to the clients and controls access to hardware, software and other resources is known as Server 4. In which year were twisted pair cables invented? 1881 5. Coaxial cables were invented in 1880 6. The network topology which combines the characteristics of bus and star topologies is Tree B. Fill in the blanks – 1. In bus topology, all computers are connected by cables to central device called hub or switch. F 2. In Mesh topology, every computer is connected to every other computer on the network. T 3. There are two general levels of network security. T 4. The optical fibre cable consists of a central glass core surrounded by several layers of protective materials. T 5. Bluetooth technology was...