0% found this document useful (0 votes)
56 views

A. Three Features That I Like in Python: CS320 - Assignment 01 1751048 - Khuu Kien An

This document contains the responses to assignment questions for the course CS320. It discusses features of the Python programming language that the student likes and dislikes. It also identifies readability, writability, reliability, and ease of code reuse and maintenance as important criteria for programming languages. Keywords, identifiers, operators, and delimiters from other languages are listed. Finally, it provides an overview of the Prolog programming language, noting its declarative nature, program structure of facts and rules, use of variables, and unification algorithm.

Uploaded by

Kien An
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
56 views

A. Three Features That I Like in Python: CS320 - Assignment 01 1751048 - Khuu Kien An

This document contains the responses to assignment questions for the course CS320. It discusses features of the Python programming language that the student likes and dislikes. It also identifies readability, writability, reliability, and ease of code reuse and maintenance as important criteria for programming languages. Keywords, identifiers, operators, and delimiters from other languages are listed. Finally, it provides an overview of the Prolog programming language, noting its declarative nature, program structure of facts and rules, use of variables, and unification algorithm.

Uploaded by

Kien An
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

CS320 – Assignment 01

1751048 – Khuu Kien An

Question 1:

I choose Python

a. Three features that I like in Python

1. Object-oriented:

Python supports object oriented language and concepts of classes and objects come into existence.

2. Large Standard Library:

Python has a large and broad library and prvides rich set of module and functions for rapid application
development.

3. Free and open source: Python language is freely available at offical web address.The source-code is
also available. Therefore it is open source.

Feature that I don’t like in Python

Extensible: You can write some of your Python code in other languages like C++. This makes Python an
extensible language, meaning that it can be extended to other languages.

b. Feature I would like to add in Python is speed. Because Python is not strong about the time
processing.

c. Criterias:

 Readability: One of the things that has made Python successful is its readability. Code is clear
and easy to understand. One of the reasons is that Python uses words for a few things that
other languages use symbols. It makes your code simple. The syntax is easy to learn. For
example, you can clearly define variable “stuff” like this:
stuff = "motorbike":
 Writability: Python can be used for an embedded controller. Abstraction in Python is achieved
by using abstract classes and interfaces. An abstract class is a class that generally provides
incomplete functionality and contains one or more abstract methods. Abstract methods are the
methods that generally don’t have any implementation, it is left to the sub classes to provide
implementation for the abstract methods. And Python is an expressive language. Expressive in
this context means that a single line of Python code can do more than a single line of code in
most other languages. We can swap the value of variables like this in Python:
var2, var1 = var1, var2
 Reliability: Python’s reliability lies in its secure environment, availability of reliable resources,
and availability of strong support community in the industry.
 Ease of Code Reuse and Maintance: You can maintain easily Python code because it is supported
by many libraries, and the writability makes it shorter than C++, and Java.

Question 3:

Keyword: if, else, do, while, return, void, sizeof

Identifier: enQueue, iter, n, WaitForSingleObject, arg, semaphore, INFINITE, num_e, N,


ReleaseSemaphore, preCount

Operator: Assign operator “=”, Unary operator “++”, Relational operator “<”

Delimiter: Semicolon ”;”

Literal: “\n”,

Values:

+ Iter = 0
Question 4:

Question 5:

 Prolog is a declarative language meaning that rather than describing how to compute a solution,
a program consists of a data base of facts and logical relationships (rules) which describe the
relationships which hold for the given application. Rather then running a program to obtain a
solution, the user asks a question. When asked a question, the run time system searches
through the data base of facts and rules to determine (by logical deduction) the answer.
 A Prolog program consists of a database of facts and rules, and queries (questions). Variables:
must begin with an upper case letter. Constants: numbers, begin with lowercase letter, or
enclosed in single quotes
 Unification. The way in which Prolog matches two terms is called unification. ... The unification
algorithm in Prolog is roughly this: df:un Given two terms and which are to be unified: If and are
constants (i.e. atoms or numbers) then if they are the same succeed.

You might also like