COMP10 (2nd Quarterly Examination)

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/66

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

67 Terms

1
New cards

The following are the features of Python programming, except:

A. It is a high-level language

B. It is extremely easy to get started.

C. It is free and open-source

D. It has its stand-alone library.

D. It has its stand-alone library.

2
New cards

Python can be on embedded to what programming language?

C/C++ Program

3
New cards

What is an interpreted, object-oriented, high-level programming language?

Python

4
New cards

Which of these describes Python's syntax?

A. Complex and verbose

B. Similar to machine code

C. Minimalistic and close to plain English

D. Requires heavy boilerplate

C. Minimalistic and close to plain English

5
New cards

Who is the creator of Python?

Guido van Rossum

6
New cards

In what year was the first version of Python (0.9.0) released?

1991

7
New cards

Which version of Python introduced Unicode support and garbage collection?

Python 2.0

8
New cards

Python 3.0 was primarily developed to:

Remove duplicate constructs and modules

9
New cards

Which of the following is NOT a key feature of Python?

A. Portable

B. Interpreted

C. Requires manual memory management

D. Extensive standard library

C. Requires manual memory management

10
New cards

Which of these applications is Python commonly used for?

A. Operation system kernels

B. Web applications and frameworks

C. Assembly programming

D. BIOS programming

B. Web applications and frameworks

11
New cards

What does "extensible" mean in the context of Python?

Python can integrate C/C++ code for performance boosts

12
New cards

Python described as "interpreted." What does this mean?

Code can run directly from the source without compilation

13
New cards

Which of the following is an example of a GUI-based desktop? application Python can build?

A. BIOS firmware

B. Image processing software

C. Operation system kernel

D. Microcontroller programs-.

B. Image processing software

14
New cards

Give 11 features of Python

1. It is a simple and minimalistic language.

2. It is extremely easy to get started.

3. It is free and open-source.

4. It is a high-level language.

5. It is portable.

6. It is an interpreted language.

7. It supports procedure-oriented programming.

8. It is extensible.

9. It can be embedded within our C/C++ program.

10. It has an extensive standard library.

11. It is an exciting and powerful language.

15
New cards

How many keywords are there in Python 3.7?

33

16
New cards

Which of the following is not a valid Python keyword?

A. and

B. true

C. elif

D. pass

B. true

17
New cards

Which keyword is used to define a function?

def

18
New cards

What is the purpose of the lambda keyword?

Define anonymous functions

19
New cards

Which of the following is a boolean keyword in Python?

A. Yes

B. False

C. No

D. Maybe

B. False

20
New cards

Which keyword is used to handle exceptions?

try

21
New cards

What does the break keyword do?

Terminates a loop

22
New cards

Which keyword continues to the next iteration of a loop?

continue

23
New cards

The keyword None represents:

Absence of a value

24
New cards

Which keyword is used to define a class

class

25
New cards

Which of the following is not allowed as an identifier?

A. _variable

B. my_var1

C. 1variable

D. variable_2

C. 1variable

26
New cards

Which keyword is used to declare a global variable?

global

27
New cards

Which of the following is used for debugging?

assert

28
New cards

What is the function of the raise keyword?

Raise an exception

29
New cards

Which of the following is not a valid identifier?

A. print_this

B. myClass

C. total$sum

D. _hidden

C. total$sum

30
New cards

Which keyword helps define an alternative name for a module?

as

31
New cards

Which keyword is used in exception handling to execute code regardless of errors?

finally

32
New cards

Which keyword checks if a value exists in a sequence?

in

33
New cards

What is the purpose of the "with" keyword?

Simplify exception handling

34
New cards

Which keyword is used to import specific parts of a module?

from

35
New cards

What will happen if you use a keyword as an identifier?

Raises a syntax error

36
New cards

The keyword yield is used in:

Generators

37
New cards

Python is a ______________ language.

Case-sensitive

38
New cards

Which of the following variable names is most meaningful?

A. c

B. count

C. x

D. n

B. count

39
New cards

The following are the features of Python, except:

A. it is simple and minimalistic language

B. It is works in Windows platform only

C. It is extremely easy to get started

D. It is exciting and powerful language

B. It is works in Windows platform only

40
New cards

A Python is a GUI-based desktop application, GUI means:

Graphical User Interface

41
New cards

Python was primarily an integral part of what Operation System?

Linux

42
New cards

Besides being quick and easy to learn, Python is free and has a support to a large community. This makes Python the preferred choice for _______ development.

Prototype

43
New cards

Which of the following design and architecture was not influenced by Python?

A. Cobra

B. CoffeeScript

C. OCaml

D. Apple Shift

D. Apple Shift

44
New cards

What are the terms used to describe the names assigned to classes, functions, variables, and similar entities?

Identifiers

45
New cards

What is the extension file of Python?

.py

46
New cards

What is the symbol that starts and ends a flowchart?

Terminal Interrupt

47
New cards

What are the reserved words in Python?

Keywords

48
New cards

What symbol that is used to separate words?

Underscore

49
New cards

A ________ should have a name that is close to the value it holds.

Variable

50
New cards

What is the keyboard shortcuts to run module in Python?

F5

51
New cards

Which of the following is an invalid identifier?

A. sum

B. #value

C. myClass

D. run_program

B. #value

52
New cards

What is a program that is generally a simple computer program that when run emits or displays on screen (often console) used in myriad of programming languages?

Hello World

53
New cards

The following are examples of keywords, except:

A. False

B. if

C. global

D. #result

D. #result

54
New cards

Write the rules for naming identifiers on the lines.

1. They can be a combination of:

a. letters in lowercase (a-z)

b. letters in uppercase (A-Z)

c. digits (0-9), or

d. underscore (_)

2. They cannot start with a digit. 1variable is invalid, but variable1 is perfectly fine.

3. They cannot use keywords.

4. They cannot use special symbols like !, @, #, $, %.

5. They can be of any length.

55
New cards

It shows that the input was received by the flowchart or an output is displayed in a flowchart.

I/O Box

56
New cards

Python is an open-source ERP, a consolidated suite of business applications, and __________ engine.

Google App

57
New cards

Python works in many platforms like...

Apple's Swift, CoffeScript, Cobra, and OCaml

58
New cards

Using Python, do the folllowing:

Codes

a = float (input ("First number"))

b = float (input ("Second Number"))

if a > b:

print("The first number is larger.")

elif b > a:

print("The second number is larger.")

else:

print("They are equal")

except ValueError:

print("Error: Please enter valid numbers.")

59
New cards

A ________ is the following of one thing after another, or the order of succession.

Sequence

60
New cards

What is a visual representation of the sequence of steps needed to perform a process.

Flowchart

61
New cards

What symbol starts and ends a flowchart?

Terminal Interrupt

62
New cards

What symbol shows that an input was received by the flowchart or an output is displayed by the flowchart?

I/O box

63
New cards

What symbol that can be the arithmetic and logical operations that happen behind the scenes.?

Process box

64
New cards

What symbol connect that parts of the program?

Off-page connector and On-page connector

65
New cards

What symbol show the flow of the process.?

Arrows

66
New cards

It refers to program lines executed in the same manner as they were placed in the program.

Sequence control structure

67
New cards

These are used to separate multiple words.

Underscore (_) or camel case (camelCase)