0% found this document useful (0 votes)
34 views5 pages

Chapter 7,8,11

Uploaded by

kimyoona0009
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views5 pages

Chapter 7,8,11

Uploaded by

kimyoona0009
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

(For Chapters 7, 11, and 8)

Chapter 7: Python Basics

A. Fill in the blanks.

1. ____________ construct is used in situations where a user can decide among multiple conditions.

2. ____________ An "if" statement must end with a ____.

3. The statement X += 1 is equivalent to ____________.

4. The statement 5 % 2 will evaluate to ____________, and 5 / 2 will evaluate to ____________.

5. ____________ is used to exit the Python Shell.

B. Spot and correct the errors in the following programs.

1. python

Value = 40

If Value >= 25

print("Smaller Value)

print "Program Over"

2. python

A = 10, B = 20

if (15 == A)

print("A"; A, "B="; B)

3. python

input('Enter a number, A)

Print ('The number is' A)


4. python

Num1 = input()

Num2 = int(input())

print(Num1 + Num2)

C. Programming Questions

1. Write a Python program to accept the length and breadth of a rectangle and calculate its area
and perimeter.

2. Write a Python program to accept three numbers from the user and display the largest number.

3. Write a Python program to check if a given number is odd or even.

D. Answer the following questions.

1. Give any two features of the Python language.

2. Explain the difference between = and == with an example.

3. What are relational operators? Give examples.

4. Identify which of the following are valid/invalid variable names. Provide reasons for invalid names.

- a. Num%

- b. First Name

- c. Value1

- d. Int

- e. Stock

5. How do you accept data from a user? Give the syntax with an example.
Chapter 11: Troubleshooting

A. Fill in the blanks.

1. You can speed up your computer by running the ____________ utility.

2. The restarting of a computer is called ____________.

3. Many printer models have a built-in ____________ option.

4. You check the power supply points for ____________ related problems.

5. Disk defragmenter is available in ____________.

B. True or False?

1. Troubleshooting is the identification of a problem in a system caused by a failure of some kind.

2. It is not important to take proper care of your computer.

3. The three areas to troubleshoot are: hardware, software, and operating system.

4. If your Windows restarts without warning, then there is a problem in the computer hardware.

5. Proper maintenance will increase the speed and life of your PC.

C. Identify the troubleshooting areas.

1. Windows stops responding.

2. The system crashes when you are working with specific software.

3. Power failure in the computer.

4. Unable to install a program.

5. Windows restarts without warning.

6. Windows starts in safe mode.

D. Answer the following questions.

1. Explain troubleshooting in brief.

2. Why is it important to take proper care of a computer?

3. What are the three areas of troubleshooting?

4. Write about two common software-related problems you’ve experienced.

5. List troubleshooting steps for handling an error message on the monitor.


Chapter 8: Loops

A. Fill in the blanks.

1. The ____________ statement skips the rest of the loop and moves to the next iteration.

2. The ____________ statement enables a program to skip over part of a ____________.

3. The ____________ part of the while loop executes only when all iterations are completed.

4. Conditions are checked for True or False, and statements execute only if the condition is
____________.

5. The ____________ loop is useful when the number of iterations is unknown.

B. Convert the following loops as directed.

1. Convert while to for:

Original Code:

python

x=5

while x < 10:

print(x + 10)

x += 2

2. Convert for to while:

Original Code:

python

for x in range(5, 20, 5):

print(x)
C. Output the following codes.

1. Code:

python

Num = 0

while Num < 10:

Num += 1

if Num == 5:

break

print(Num, end="")

2. Code:

python

for val in "String":

if val == "l":

break

print(val)

print("Over")

D. Answer the following questions.

1. Why are iterations significant in Python?

2. Explain the range() function with an example.

3. Differentiate between for and while loops.

4. What are jump statements in Python? Provide examples.

You might also like