(base) MAC:Tue Sep 01:10:32:week2> python Point.py Traceback (most recent call last): File "Point.py", line 6, in p = Point(3,4) TypeError: __init__() takes 1 positional argument but 3 were given (base) MAC:Tue Sep 01:10:33:week2> !vi vi Point.py (base) MAC:Tue Sep 01:10:33:week2> !p python Point.py <__main__.Point object at 0x7ffd394dc5d0> (base) MAC:Tue Sep 01:10:33:week2> !vi vi Point.py (base) MAC:Tue Sep 01:10:34:week2> !p python Point.py (3, 4) (base) MAC:Tue Sep 01:10:34:week2> !vi vi Point.py (base) MAC:Tue Sep 01:10:36:week2> !p python Point.py (3, 4) (0, 0) (base) MAC:Tue Sep 01:10:36:week2> !vi vi Point.py (base) MAC:Tue Sep 01:10:40:week2> !p python Point.py (3, 4) (0, 0) 5.0 Traceback (most recent call last): File "Point.py", line 19, in print(p.taxicab_distance(q)) File "Point.py", line 13, in taxicab_distance return math.abs(self.x - other.x) + math.abs(self.y - other.y) AttributeError: module 'math' has no attribute 'abs' (base) MAC:Tue Sep 01:10:40:week2> !vi vi Point.py (base) MAC:Tue Sep 01:10:40:week2> !p python Point.py (3, 4) (0, 0) 5.0 7 (base) MAC:Tue Sep 01:10:40:week2> !vi vi Point.py (base) MAC:Tue Sep 01:10:45:week2> jshell | Welcome to JShell -- Version 14.0.1 | For an introduction type: /help intro jshell> ArrayList al = new ArrayList<>(); | Error: | unexpected type | required: reference | found: int | ArrayList al = new ArrayList<>(); | ^-^ jshell> //primitive types cannot be used as type parameters jshell> jshell> ArrayList al = new ArrayList<>(); al ==> [] jshell> al.add(56) $2 ==> true jshell> al.add(44) $3 ==> true jshell> al.add(15) $4 ==> true jshell> al al ==> [56, 44, 15] jshell> Integer q = 7; q ==> 7 jshell> ## this is a tacit call to new. | Error: | illegal character: '#' | ## this is a tacit call to new. | ^ | Error: | illegal character: '#' | ## this is a tacit call to new. | ^ jshell> //this is a tacit call to new. jshell> jshell> Integer r = new Integer(5); r ==> 5 jshell> int s = r; s ==> 5 jshell> //unboxing jshell> s.toString() | Error: | int cannot be dereferenced | s.toString() | ^--------^ jshell> Integer.BYTES $9 ==> 4 jshell> Integer.MAX_VALUE $10 ==> 2147483647 jshell> Integer.MIN_VALUE $11 ==> -2147483648 jshell> Integer.TYPE $12 ==> int jshell> Integer n = Integer.valueOf(7); n ==> 7 jshell> n = 7; n ==> 7 jshell> String num = "32324"; num ==> "32324" jshell> int number = Integer.parseInt(num); number ==> 32324 jshell> number number ==> 32324 jshell> String crazy = "baaa"; crazy ==> "baaa" jshell> number = Integer.parseInt(num, 16) number ==> 205604 jshell> number number ==> 205604 jshell> //this convertedd the string from base 16 to decimal jshell> Integer.toString(1000, 16) $21 ==> "3e8" jshell> Integer.toString(1000, 5); $22 ==> "13000" jshell> Integer.parseInt("cows") | Exception java.lang.NumberFormatException: For input string: "cows" | at NumberFormatException.forInputString (NumberFormatException.java:68) | at Integer.parseInt (Integer.java:652) | at Integer.parseInt (Integer.java:770) | at (#23:1) jshell> # exception is a runtime error | Error: | illegal character: '#' | # exception is a runtime error | ^ | Error: | ';' expected | # exception is a runtime error | ^ jshell> //exception is a runtime error jshell> Character.BYTES $24 ==> 2 jshell> Character.digit('a', 16) $25 ==> 10 jshell> Character.isDigit('6') $26 ==> true jshell> Character.isWhitespace('\n') $27 ==> true jshell> Character.isWhitespace('\t') $28 ==> true jshell> Character.toString('a') $29 ==> "a" jshell> "" + 'a' $30 ==> "a" jshell> Double.parseDouble("6.02e23") $31 ==> 6.02E23 jshell> Double.toString(45.4) $32 ==> "45.4" jshell> "" + 45.4 $33 ==> "45.4" jshell> /exit | Goodbye (base) MAC:Tue Sep 01:11:17:week2> ls Point.py session.txt (base) MAC:Tue Sep 01:11:17:week2> vi BadBreath.py (base) MAC:Tue Sep 01:11:45:week2> python BadBreath.py The square of 0 is 0. The square of 1 is 1. The square of 2 is 4. The square of 3 is 9. The square of 4 is 16. 16 (base) MAC:Tue Sep 01:11:45:week2> !vi vi BadBreath.py (base) MAC:Tue Sep 01:13:42:week2>