SHARE
TWEET

BOT

a guest Jan 28th, 2020 103 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. print("Hi! I am SPEA, your personal bot. ")
  2. print("NB:SPEA=square perimeter and area")
  3. userName = input("Can you tell me your name, please? ")
  4. print("Nice to meet you! " + userName)
  5. print("Let's calculate the area and perimeter of a square")
  6. input1 = input("Length>")
  7. input2 = input("Width>")
  8. item1 = int(input1)
  9. item2 = int(input2)
  10. result1 = item1 * item2
  11. result2 = (item1 * 2) + (item2 * 2)
  12. output1 = str(result1)
  13. output2 = str(result2)
  14. print("Area = " + input1 + " * " + input2 + " = " + output1)
  15. print("Area = " + output1 + "units squared")
  16. print("Perimeter = " + "2" + "*" + "(" + input1 + " + " + input2 + " )" + " =" + output2)
  17. print("Perimeter = " + output2 + "units")
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top