My own code

python

#1

this is my code for the caeser cipher but it comes up with errors that I cant fix please help
1. import sys
2.
3. def main(argv):
4. if (len(sys.argv) != 2):
5. sys.exit('Usage: sub.py ')
6.
7. plaintext = list(raw_input('Enter message: '))
8. alphabet = list('abcdefghijklmnopqrstuvwxyz')
9. k = int(sys.argv[1])
10. cipher = '' "
11.
12. for c in plaintext:
13. if c in alphabet:
14. cipher += alphabet[(alphabet.index(c)+k)%(len(alphabet))]
15.
16. print 'Your encrypted message is: ' + cipher
17.
18.
19. if name == "main":
20. main(sys.argv[1:])


#2

Use one of the following instructions to make your code indent visible:

select your code and press ctrl + shift + c (or cmd + shift + c if you use a mac)

if this instructions are unclear, you can also insert 3 backticks before and after your code, like so:

```
<p>visible</p>
```

the backtick is located above the tab key on your keyboard