Unit 1 : Computer Basics
Q1. What is a computer?
A1. A computer is an electronic device/machine which takes input, processes the data, and produces output.
Charles Babbage invented the computer.
Q2. List the basic parts of a computer.
A2. The five basic parts of a computer are:
1. Input Unit
2. Output Unit
3. Central Processing Unit (CPU)
4. Arithmetic and Logical Unit (ALU)
5. Control Unit
Q3. What is primary memory?
A3. Primary memory is the memory that is present in the computer internally. Moreover, it stores data and
information while processing takes place. It is a volatile memory i.e. it loses data once the power is off.
Examples are RAM and ROM.
Q4. What is secondary memory?
A4. Secondary devices store data permanently. Example: CD, DVD, etc.
Q5. List the features/advantages of a computer.
A5. A computer has the following features such as:
1. Efficiency
2. Speed
3. Reliable
4. Versatile
5. Storage
Q6. What is software?
A6. The software can be defined as the set of programs written to perform various special tasks or functions
on the computer. In addition, it can be classified further into two categories, which are System Software and
Application Software.
Q7 What are system software?
A7. The system software is responsible for handling all the internal workings of a computer. Some types of
system software are:
1. Operating System: An operating system is basically software used for interaction between the user
and the computer hardware. It controls all the parts of a computer system and manages
them. Examples are Microsoft Windows, Linux, etc.
2. Language Processors: converts the code given by the user (source code) to computer language
(machine code).
3. System Utilities: This software is responsible for the proper and smooth functioning of computers.
And also, keeping the system safe. Examples are Antivirus Software, File Management Tools, etc.
4. Device Drivers: This software basically has the instructions in order to run the hardware devices.
5. Application Software: This software performs only a specific task. Examples are MS-
Excel, PowerPoint, Google Chrome, etc.
Q8 Draw Block Diagram of computers?
Q9 Explain Central Processing Unit (CPU) ?
A9. This is a really important part of a computer as it performs all the processing parts of the computer. The
CPU carries out and performs different calculations and other operations on the data and instructions. It has
two subparts:
1. Arithmetic and Logical Unit (ALU): As the name suggests, this unit is responsible for performing
arithmetic tasks like addition, subtraction, multiplication, division and also making logical
decisions like greater than less than, etc. Hence, its name is also the ‘brain’ of the computer.
2. Control Unit (CU): This unit is responsible for looking after all the processing being done. It
organizes and manages the execution of tasks that the CPU performs.
Q10. Explain types of computer ?
1 Supercomputer
They are used to store and process very large amounts of information. For example, satellite images and
navigation, in the defense system, etc.
2 Mainframe computer
They are used by government and businesses to process very large amounts of information.
3 Minicomputers
They are similar to mainframe computers and are used by the government and businesses to process very
large amounts of information.
4 Personal computers
Also known as PCs, they are smaller and less powerful than others. They are used in homes, schools and
small businesses.
Unit 2 : Scratch Programming
Q1. What is Scratch programming?
Ans : Scratch is a software platform that allows users to create interactive stories, animations, and games. It
provides a block-based programming interface where users can drag and drop blocks of code to create their
projects.
Q2. What are block palette.
Ans : The block palette is where the different script blocks are located. The different type of script blocks
include: motion, control, looks, sensing, sound, operators, pen, variables. This website will go into greater
detail for each function as you progress. The purpose of this section is to just give you a rough idea of each
script type.
Motion - controls the up, down, left, right, and rotation movement of the sprites.
Control - allows you to specify things such as what starts and stops your sprites, how you can move
the object, conditional operators such as if/then and repetition.
Looks - affects the appearance of your sprite such as color and costume.
Sensing - controls to sense if your sprite is touching the edge, another color, another sprite, at a
specific X or Y coordinate, the sound volume, etc.
Sound - control sounds, pitches, and volume.
Operators - Logic operators including tools to perform match functions, select a random number,
greater than, less than, equal to, etc.
Pen - pen functions allows you to draw lines and objects on the stage.
Variables - create variables to hold numbers or text.
Q3. What is a sprite?
Ans. Sprite is the actor who acts on the stage. It is an object in Scratch that
performs the function on the stage.
Q4. Name any three components of Scratch desktop.
Ans. Sprite, Menu bar and Title bar.
Q5. What is the use of Motion blocks?
Ans. Motion blocks are used to control the movement of a sprite.
Q6. Write steps to change the appearance of a sprite.
Ans. Step 1 – Click on the costumes tab.
Step 2 – Click on the image of the sprite. Drag the selection blue border to select the cat.
Step 3 – Click on fill and outline options to change the colors of the cat and the outline.
Q7. What is the function of the 'when green flag clicked' command block?
Ans. The 'when green flag clicked' command block is used to initiate the execution of a script when the
green flag is clicked. Once the green flag is clicked, the script associated with this block will run, allowing
the program to perform its intended actions.
Q8. What do you mean by Stage in the context of Scratch programming.
Ans. In the context of Scratch programming, the background is referred to as the "Stage." The Stage is
where all the action takes place in a Scratch project. It acts as the backdrop for the sprites (characters and
objects) and can be customized with different images or colors to set the scene for your game.
Unit 3 : Introduction to python programming
Python is a very popular general-purpose, interpreted, and high-level programming
language. It was created by Guido van Rossum during 1993.
What can Python do?
• Python can be used on a server to create web applications.
• Python can be used alongside software to create workflows.
• Python can connect to database systems. It can also read and modify
files.
• Python can be used to handle big data and perform complex
mathematics.
• Python can be used for rapid prototyping, or for production-ready
software development.
There are different type of Python Application and features –
1. Web and Internet Development
2. Desktop GUI Application
3. Software Development
4. Database Access
5. Business Application
6. Games and 3D Graphics
Building blocks of python
Python 3 is a popular high-level programming language used for a wide variety of
applications. Here are some basics of Python 3 that you should know:
1. Variables: In Python 3, variables are created by assigning a value to a name.
For example, x = 5 creates a variable called x and assigns the value 5 to it.
2. Data types: Python 3 supports several built-in data types, including
integers, floats, strings, booleans, lists, tuples, and dictionaries.
3. Operators: Python 3 supports a variety of operators, including arithmetic
operators (+, -, *, /), comparison operators (>, <, ==, !=), and logical
operators (and, or, not).
4. Control flow statements: Python 3 supports several control flow
statements, including if-else statements, for loops, and while loops. These
statements allow you to control the flow of execution in your code.
5. Functions: In Python 3, functions are created using the def keyword. For
example, def my_function(x): creates a function called my_function that
takes one argument called x.
• Input function in python : input() is to get user input .
For eg. :
X = input (“Enter your First Name”)
Y = input (“Enter your Last Name”)
Name= X+Y
print (Name)
• Output function in python : print() function is used for output. It will show the text to
the console.
For eg. :
x = "Python is awesome"
print(x)
Output will be : Python is awesome
In the print() function, you output multiple variables, separated by a comma:
Example
x = "Python"
y = "is"
z = "awesome"
print(x, y, z)
You can also use the + operator to output multiple variables:
Example
x = "Python "
y = "is "
z = "awesome"
print(x + y + z)
Notice the space character after "Python " and "is ", without them the result
would be "Pythonisawesome".
Variables
Variables are the names you give to computer memory locations which are used to store
values in a computer program.
For example, assume you want to store two values 10 and 20 in your program and at a
later stage, you want to use these two values. Let's see how you will do it. Here are the
following three simple steps −
• Create variables with appropriate names.
• Store your values in those two variables.
• Retrieve and use the stored values from the variables.
Rules for Python variables:
• A variable name must start with a letter or the underscore character
• A variable name cannot start with a number
• A variable name can only contain alpha-numeric characters and underscores
(A-z, 0-9, and _)
• Variable names are case-sensitive (age, Age and AGE are three different
variables)
Legal variable names example:
myvar = "John"
my_var = "John"
_my_var = "John"
myVar = "John"
MYVAR = "John"
myvar2 = "John"
Illegal variable names example:
2myvar = "John"
my-var = "John"
my var = "John"
Datatype
In Python, each value has a datatype. Data types are basically classes, and variables are
instances (objects) of these classes, because everything in Python programming is an
object.
Python has a number of different data types. The following are some of the important
datatypes.
1. Int – Int datatype is used to store the whole number values. Example : x=500
2. Float – Float datatype is used to store decimal number values. Example : x=50.5
3. String – Unicode character values are represented by strings in Python.
Because Python does not have a character data type, a single character is
also treated as a string. Single quotes (‘ ‘) or double quotes (” “) are used
to enclose strings. These single quotes and double quotes merely inform
the computer that the beginning of the string and end of the string. They
can contain any character or symbol, including space. Example : name =
”Rakesh kumar”
4. Boolean – Boolean is used to check whether the condition is True or
False. Example : x = 15 > 6 type(x)