Advertisement
Carl123432

PythonTwitterLeassonEP2

Jan 16th, 2019
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.97 KB | None | 0 0
  1. ## Simple maths in python
  2. ## Note: You can not add a string and a integer together it will cause a error and your program will crash, the computer does not understand what you are asking it to do.
  3.  
  4. A = 4
  5. B = 6
  6. C = A + B
  7. print(C)
  8. #>>> 10
  9. #We have set 3 variables up, A = Integer, B = Integer, C = Integer+Integer which returns 10 as 6 + 4 = 10
  10. A = 10
  11. B = 5
  12. C = A - B
  13. print(C)
  14. #>>> 5
  15. # Now we have done the same as last time, but this time we have subtracted the integers.
  16. A = 20
  17. B = 5
  18. C = 20 * 5
  19. print(C)
  20. #>>> 100
  21. # This time we have multiplied the two variables
  22. A = 20
  23. B = 2
  24. C = 20 / 2
  25. print(C)
  26. #>>> 10
  27. # We have now divided the two variables
  28. # This is just the basics of some of the math you can do within python, i say some, but you can do a lot of math in python.
  29. # Soon i will start to create videos on this series, but i would like to get the basic out of the way so must people have a basic understanding of python before we start our Twitter bot program.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement