Monday, December 8, 2014

Activity 1.3.6- Tuples and Lists




Conclusion
1.       Consider a string, tuple, and list of characters.

In []: a = 'acbde'
In []: b = ('a', 'b', 'c', 'd', 'e')
In []: c = ['a', 'b', 'c', 'd', 'e']

The values of a[3], b[3], and c[3] are all the same. In what ways are a, b, and c different? 
 a is a string, b is multiple strings in a tuple, and c is multiple strings in a list.

2.      Why do computer programming languages almost always have a variety of variable types? Why can't everything be represented with an integer?
 Not everything can be represented by an integer because you can't represent a letter with an integer.

No comments:

Post a Comment