Python Basics

  1. Single line comment
    # This is a comment
  2. Multi-Line comment
line 2
line 3
"""```
3. Exponentiation
```eggs = 10 ** 2    #10 to the power of 2, eggs = 100```

4. String index
```fifth_letter = "MONTY"[4]    #fifth_letter = "Y"```

5. lower()

parrot = "Norwegian Blue"
parrot.lower()
print parrot.lower() #norwegian blue
print parrot #Norwegian Blue


6. str()
``` pi = 3.14
print str(pi)

你可能感兴趣的:(Python Basics)