What is the purpose of this table?

  • Thread starter MissP.25_5
  • Start date
  • Tags
    Programming
In summary, we discussed learning scheme programming and the result of using the small function with the list "apple" and "100 yen". We also learned that when comparing strings, alphabetical order or ASCII values of characters are used, with numerals being less than upper case letters and lower case letters. In the case of comparing "a" and "1", the numerical value of "1" would be less than the alphabetical value of "a". The ASCII table was also provided as a reference for further understanding.
  • #1
MissP.25_5
331
0
I am learning scheme programming.
What is the result of this?

(define (small a b)
(string<? (first a) (first b))

And the list is (list "apple" "100 yen").

What is the first a and what is the first b? Is it "a" and "1"? If so, between these two, which is lesser?
 
Physics news on Phys.org
  • #2
Assuming ascii, then '1' is less than 'a'.
 
  • #3
When you compare strings you use alphabetical order, or ASCII values of the characters.

numerals ( 0 1 ...) < UPPER CASE LETTERS < lower case letters
 
  • #4
Willy_B said:
When you compare strings you use alphabetical order, or ASCII values of the characters.

numerals ( 0 1 ...) < UPPER CASE LETTERS < lower case letters

But here we have both numbers and letters. How do you compare a and 1?
 
  • #5

FAQ: What is the purpose of this table?

What is programming?

Programming is the process of designing, writing, testing, and maintaining computer programs. It involves creating instructions or code that a computer can execute to solve a specific problem or perform a certain task.

What programming languages should I learn?

The programming language you should learn depends on what you want to achieve and the type of software you want to develop. Some popular languages include Java, Python, C++, and JavaScript. It's best to research and choose a language that aligns with your goals and interests.

Is programming difficult to learn?

Like any skill, programming can be challenging to learn at first. However, with practice and dedication, anyone can learn to code. It's important to start with the basics and build a strong foundation before moving on to more advanced concepts.

Do I need a degree to become a programmer?

No, you do not necessarily need a degree to become a programmer. Many successful programmers are self-taught or have learned through online courses. However, having a degree in computer science or a related field can provide a strong foundation and make it easier to land a job in the field.

Can I become a programmer if I have no prior experience?

Yes, anyone can become a programmer with dedication and hard work. It's important to start with the basics and practice regularly. There are many online resources and courses available for beginners to learn programming from scratch.

Similar threads

Replies
4
Views
1K
Replies
1
Views
1K
Replies
10
Views
1K
Replies
13
Views
986
Replies
21
Views
2K
Replies
8
Views
1K
Replies
2
Views
2K
Back
Top