Computer Science
Computer Science
system
1.What is a computer?
5.What is Encoding?
A. Encoding is a system that maps characters,
symbols, or textual elements to numeric values or bit
patterns for digital representation and storage. It is
used to represent human-readable text and symbols as
binary data, which can be processed, transmitted, and
stored in computers and other digital systems.
10. Convert
●32 MB into Bytes.
●512 GB into TB.
●256 TB into KB.
19. What is
Primary memory?
Cache memory?
Secondary memory?
28. “If the IDs of two objects are same than they must
have same value, but if any two objects have same
value they may not have same ID”. Explain with an
example.
29.
30.
31.
32.
34.
35. What functions are available in Python for type
casting? Explain.
38.
39.
40.
.
47. Write 2 examples of High Level Programming
Languages and low level programming language .
A. Python and C++.
B. Binary Language and Assembly
Language.
Ans.
Or
86. Write a program to compute the radius of a circle.
Derive your formula from the given equation: A=πr²,
then display the output.
CH:02 Python Basics
1.
2.What is an identifier?
3.Differentiate between runtime errors and logical
errors.
4.What is the purpose of giving meaningful name for
identifiers?
5.What do you mean by debugging?
6.What is indentation? Explain with an example.
7.Explain all steps of problem solving process.
8.Explain types of errors with examples.
9.Differentiate between runtime errors and logical
errors.
10.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30. When will following statement in interpreter
result into error:
>>> B+4
31. How can we change the value of 6*1-2 to -6
from 4?
32. Name four of Python‟s Basic data types? Why
are they called so?
33. What are relational operators? Explain with the
help of examples.
34. How are keywords different from variable
names?
35. Why are data types important?
36. How can you convert a string to integer and
when can it be used?
37.
loops
1.Explain the purpose of the break and continue
statements in Python.
2.Explain if...else statement with syntax and
example.
3.Explain while loop with syntax and example.
15.
16.
17. Write a program to arrange three numbers in
ascending order.
18.
19.
20.
26.
32.
42.
44.
45.
57.
59.
69.
79.
80.
81.
82.
83.
84.
85.
86.
87.
88.
89.
90.
91.
92.
93.
94.
95.
96.
97.
98.
109. Example
110. Write a script that asks a user for a
number. Then adds 3 to that number, and then
multiplies the result by 2, subtracts twice the
original number, then prints the result.
111.In analogy to the example, write a script that
asks users for the temperature in F and prints
the temperature in C.
(Conversion: Celsius = (F - 32) * 5/9).
112. Write a Python function, odd, that takes
in one number and returns True when the
number is odd and False otherwise. You
should use the % (mod) operator, not if.
113. Define a function „SubtractNumber(x,y)‟
which takes in two numbers and returns the
difference of the two
133.
134.
135.
136.
137.
138.
139.
140.
141.
142.
143.
Write a Python program to count the number
of strings of length 2 or more and the first and
last character are same from a given list of
strings