CT320 IQ 13
Show Main.IQ13 as a slide show.
Version
Which version of Python did we discuss?
- Python 1
- Python 2
- Python 3
- Python 4
- Python 5
- Perl 6
Types
Which one of these aggregate types can only hold
values of the same type?
- list
- tuple
- set
- dictionary
- none of the above
List
print(type((1,2,3)));
<class 'tuple'>
print(type([4,5,6]));
<class 'list'>
print(type({7,8,9}));
<class 'set'>
print(type(<10,11,12>));
File ".py3", line 1
print(type(<10,11,12>));
^
SyntaxError: invalid syntax
Which of these is a list?
(1,2,3)
[4,5,6]
{7,8,9}
<10,11,12>
String matching
print("C.*a" in "Chihuahua")
False
True
False
0
"Chihuahua"
- It won’t compile.
in
does simple string matching, not regular expressions
Substrings
What will this code display?
s="abcde"
s[3] = '123'
print(len(s))
Traceback (most recent call last):
File ".py3", line 2, in <module>
s[3] = '123'
TypeError: 'str' object does not support item assignment
3
5
7
8
- It won’t compile.
strings are immutable
print
How many lines will this display?
print('alpha')
print('beta', 'gamma')
print('delta\n')
alpha
beta gamma
delta
- 2
- 3
- 4
- 5
- It won’t compile.
sendmail
sendmail is an:
- MDA
- MRA
- MSA
- MTA
- MUA
CT320: Networking, Sys Admin, and Art History
Who painted the postman in the previous question?
- Andy Warhol
- Leonardo da Vinci
- Pablo Picasso
- Rembrandt
- Vincent van Gogh
MUA
Which one of these is an MUA?
- gmail
- imapd
- MIME
- sendmail
- thunderbird
SMTP Port
egrep ' (22|25|80|465|587)/tcp' /etc/services
ssh 22/tcp # The Secure Shell (SSH) Protocol
smtp 25/tcp mail
http 80/tcp www www-http # WorldWideWeb HTTP
submission 587/tcp msa # mail message submission
urd 465/tcp smtps # URL Rendesvous Directory for SSM / SMTP over SSL (TLS)
SMTP occurs on port:
- 22 ssh
- 25 smtp
- 80 http
- 465 old port for smtps
- 587 mail submission
Memorization
Should I memorize port numbers?
- Certainly not.
- Probably not.
- Well, maybe.
- I know them all!
- Probably not, but you should know a few really well-known port numbers.
Mail Handling Record
Which DNS record indicates a host that handles mail?
- A
- AAAA
- CNAME
- MH
- MX