[Question]
  [
Given an expression like `4 / 2 + 3`, determine whether the expression has the same value in Python 2 and Python 3. Recall that in Python 2 division rounds down (so that `5 / 2 -> 2`), whereas in Python 3 division returns a float (so that `5 / 2 -> 2.5`).
For simplicity's sake, we will only consider expressions of the form:
```
a o1 b o2 c
```
Where
* `a`, `b`, and `c` are numbers between 1 and 5 inclusive; and
* `o1` and `o2` are either the addition, multiplication or division operators (`+`, `*`, `/`)
Note that the restrictions mean the expression will always be the same length and will never have any zero division issues.
Operator precedence is the same as in Python (`*` and `/` have equal and higher precedence to `+`, evaluated left to right).
Since this is in part a parsing challenge, you must take the input exactly as given including spacing in a string-like form appropriate for your language (and not, for example, a preparsed AST).
You can print or return any two distinct consistent values to indicate true or false.
## Test cases
```
1 + 2 + 3 -> true
2 * 3 + 5 -> true
3 / 3 + 3 -> true
4 / 2 * 2 -> true
2 * 2 / 4 -> true
4 / 2 / 1 -> true
5 + 4 / 2 -> true
1 / 2 + 3 -> false
5 / 2 * 2 -> false
3 / 2 * 4 -> false
2 + 3 / 5 -> false
4 / 4 / 4 -> false
```
## Scoring
This is code golf, shortest code in bytes wins.
  
[Answer]
# [C (clang)](http://clang.llvm.org/), ~~121~~ \$\cdots\$ ~~119~~ 117 bytes
```
#define P(v)v=*x-47?*x-43?v*a:t?a:v:v/a
float d;b;t;a;f(*x){for(t=b=d=*x-48;*++x;t=!++x)a=x[1]-48,P(d),P(b);*x=d==b;}
```
[Try it online!](https://tio.run/##ZVBNc5swEL37V2zpeEYSeAhg2tSK4kOntxxy8M32QRYiZULAgzSE1uO/XrLmq3YLYnl6u/t256mFymXx0rafE51mhYZnUtNasGax/Lq@xGhdM7mya7mqV7UvZ2leSgsJP3DLJU8Ja@gpLStixUEkXd89Z67bcCs@4Y9K0WyDPbLeM0kohgPlrMFSceDnNissvMmsIBROM8AHCQZWG2u2exBwenICN3Qjx4MnJ2SRG3co8qOBW/ohC4ds6C9Hzg86FLuIOxT4o0o8dUSI@g7M@fHQi69z5uMyoJujVlYn/TqBB/@fu@sztKqyMBbUT1kxjFq96qpXcHbNj3DXfPuO32Xk9T0aB6OhQC7TsyLRDbbd8QE@gMl@6zIl417UHwg2MRxct6umnVhv7GTuBuV6g7uaPb9NW0y/yTwvFfnClvRv9l0ZdfxFrAebKzYllt4ogLnob@NbXdDITlb@O/hYYUlKnHluYPEI8wTmZlegORsPjDf5Z4TQ@@vZldbT@PPs3P5RaS5fTLt4/wA "C (clang) – Try It Online")
Inputs the Python expression as a wide string.  
Parses the string and returns (at the end of the input string) \$1\$ if the expression is the same in both Python 2 and 3 or \$0\$ otherwise.
### Commented code
```
#define P(v)                              // Macros are type-less so will    
                                          // calculate both floating point   
                                          // and integral values  
            v=                            // set the parameter to:   
              *x-47?                      // is the char at *x not '/' ?    
                    *x-42?                // is the char at *x not '+' ?     
                          v*a:            // then it's '*' so multiply      
                              t?          // here it's '+' so check t   
                                a:        // t is only truthy at the start   
                                          // so set parameter to a   
                                  v:      // after that t's 0 so leave    
                                          // parameter as is   
                                    v/a   // here it's '/' so divide     
float d;                                  // floating point type for Python 3    
                                          // calculations   
        b;                                // integral type for Python 2    
                                          // calculations   
          t;                              // toggle for signalling first and   
                                          // second parts   
            a;                            // value in Python expression   
f(*x) {                                   // function taking wide string    
                                          // parameter
       for(                               // loop over first and  
                                          // second part   
           t=                             // set t to non-zero value   
             b=d=*x-48;                   // set d and b to first number   
                       *++x;              // move pointer to next char and   
                                          // finish looping at the end of the    
                                          // input string   
                            t=!           // after first loop set t=0   
                               ++x)       // bump x again   
            a=x[1]-48,                    // set a to next number   
                      P(d),               // parse with floating point type   
                           P(b);          // parse with integral type   
        *x=d==b;                          // set end of string to 1 if the      
                                          // floating point value is equal to    
                                          // integral or 0 otherwise      
}     
```
[Answer]
# [Python 2](https://docs.python.org/2/), 28 bytes
```
lambda s:eval("1.*%s.>"%s+s)
```
[Try it online!](https://tio.run/##K6gsycjPM/qfZhvzPycxNyklUaHYKrUsMUdDyVBPS7VYz05JtVi7WPN/QVFmXolGGlBYQVvBCIiNlTQ1ueCiRgpaCsZAUVMUUWMFfbAoqloToChIvRGGCUZAGRMsavUVDFFETYFmgmVQRA3BatFtM8VqmzFU1ATNDUDdQBlTDDeYQF32HwA "Python 2 – Try It Online")
This saves a byte using that Python 2 value will always be less or equal within the constraints of this challenge. Inverted output: False means safe, True unsafe.
## Old [Python 2](https://docs.python.org/2/), 29 bytes
```
lambda s:eval("1.*%s.=="%s+s)
```
[Try it online!](https://tio.run/##K6gsycjPM/qfZhvzPycxNyklUaHYKrUsMUdDyVBPS7VYz9ZWSbVYu1jzf0FRZl6JRhpQXEFbwQiIjZU0NbngokYKWgrGQFFTFFFjBX2wKKpaE6AoSL0RhglGQBkTLGr1FQxRRE2BZoJlUEQNwWrRbTPFapsxVNQEzQ1A3UAZUww3mEBd9h8A "Python 2 – Try It Online")
Forces Python 3 semantics in Python 2 by converting terms 1 and 3 to float, evaluates and compares to the original.
[Answer]
# [Python 3.8 (pre-release)](https://docs.python.org/3.8/), 33 bytes
```
lambda s:eval(s)%1>eval(s[:5])%-1
```
[Try it online!](https://tio.run/##K6gsycjPM7YoKPqfZhvzPycxNyklUaHYKrUsMUejWFPV0A7CirYyjdVU1TX8X1CUmVeikaahZKigrWAExMZKmppccFEjBS0FY6CoKYqosYI@WBRVrQlQFKTeCMMEI6CMCRa1@gqGKKKmQDPBMiiihmC16LaZYrXNGCpqguYGoG6gjCmGG0ygLvsPAA "Python 3.8 (pre-release) – Try It Online")
Port of tsh's Javascript answer.
### Old version
# [Python 3.8 (pre-release)](https://docs.python.org/3.8/), 41 bytes
*Thanks [@Unrelated String](https://codegolf.stackexchange.com/users/85334/unrelated-string) for -2 bytes through some eval wizardry*
```
lambda s:eval(s+'=='+s.replace("/","//"))
```
[Try it online!](https://tio.run/##bY7NCsIwEITvPsWSS1MjhvyBCHkTL1FTFGIb0iL49HENRUjbw16@mZ2Z@JkeQ69OMeXOXnJwr@vdwXj2bxfoyBprGzYek4/B3TwlnBwI56Rtc0zPfqIdJQIYSDyFdPenEvagkJqKKuCF1l6N9OeXqwSJit7wchAVNZhZlIqK4l22mc02NVO92IDfqJjVBj0vy18 "Python 3.8 (pre-release) – Try It Online")
[Answer]
# [Desmos](https://desmos.com/calculator), ~~122~~ 113 bytes
```
L=l-48
g(a,b,o,k)=\{o=-6:ab,o=-1:a/b,k=0:b,a\}
h(k)=mod(g(g(L[1],L[5],L[3],0),k,L[7],1),1)
F(l)=\{h(L[9])>-h(1)\}
```
Basically just a port of tsh's Javascript answer, though a bit more complicated (when was using Desmos in a string parsing challenge ever a good idea??).
Takes in input as a list of character codepoints. Returns `undefined` for truthy cases, and `1` for falsey cases.
Use this [TIO link](https://tio.run/##JYxBCsIwEEX3nmLIKqmuLIK4FbxE4yLaaROomWE6RYp49hjs8r/3@LxqpNyeWUphSVmtuRKvwGFWBI0ID5zoDU/qEaqmPxslcIQ6ZtwiWpQXvRi3204Gc/N@wkHtp2tegS1Jf0i5Nta5@9d7SWNUZ1wpR2ighT2cfg) to convert from string input (`2 * 3 + 5`) to list of codepoints wrapped in the output function (`F\left([50, 32, 42, 32, 51, 32, 43, 32, 53]\right)`) which can be copy pasted into Desmos directly.
[Try It On Desmos!](https://www.desmos.com/calculator/stjjiouqoe)
[Try It On Desmos! - Prettified](https://www.desmos.com/calculator/lr08ez02pb)
[Answer]
# [JavaScript (Node.js)](https://nodejs.org), 29 bytes
* Saved 1 bytes by [dingledooper](https://codegolf.stackexchange.com/users/88546/dingledooper)
```
s=>eval(s)%1>-eval(s+'**0')%1
```
[Try it online!](https://tio.run/##Xc7LDoIwEAXQPV9xN4aXUHm4IrDzL4yxweIjYA2tbIzfjiNVQBdt2tM7M73wjquyPd90cJUH0Vd5r/JCdLx2lLuIisAcfdvzVjZBr5Fjb0XwEdNKEBTQ7V1YMTy6@ViPkoANMmVSkncu/qmKSdO/DEM0ypp6GP0KjWfT@IrX6p2a9TaUfCidyBQx80tD6TCezVP7sOG6PDlstz0gxGdjzdHNLB1Wst1wehXICzw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TqrP6s/qz@LP4s/lx/6JQ@UPFDyQM0DNQ/UPFDyQMkDNQ@UPFDyQF0bqH2g9oHaB0ofKH2g9oHSB0of6HkfuHiYlbJSXtkT7An2BHuCPcGeYE@0J9oT7Qn2BHvC7AnyBHnC7InuRHeiO8Gd4E6cPUGeIE@cPdGeaE@0J9gT7Ln83i@VoFSCUgnq6kBdHaidoHSC0glqJyidoHSCnneCC8pKWSmv3CnuFHeKO8Wd4k5xp3zrlG@d8q1TxCni1LFTzCnm1LFTvnXKt04Vp4hTxKniFHGKOFWc8q1TvnWqNkWbok0dOsWb4k0dOuVbp3zrVG2KNkWbXr3/R24duXXk1olbJ27RB3548fjx7U@3z148fLh/@3h787d3N89e/PT6w@394eWrw/3X488Xbp49@/6bD68fHg4vD48v7n65@/jv29u/vv3j4e7vzz7/4f98czj8@P7dw@Ph/dOfeHP79un05csvv@f7p599vHv8@eO7px8@P9zcPP3o8HT636e/8vOd9/d3L@7f//P217/@L4ebz/@@Ofz5cPPm9dv7m2fff/of)
Basic idea: The expression is "Python 2 / 3 safe" iff both `a o1 b o2 c` and `a o1 b o2 1` is integer after evaluate.
[Answer]
# x86-64 machine code, ~~34~~ 33 bytes
```
B8 66 41 AD AC AC 24 07 9E 92 66 98 7A 0A 72 03 F6 E2 92 FF CF 7B EA B8 F6 F2 84 E4 74 F4 24 80 C3
```
[Try it online!](https://tio.run/##XVLLbtswEDxzv2KqwoBkK47fTe26QJtee@mpQJIDTVIWC5kyTLmRY/jX6y7V@JEeuMTszA6XS6r1@map1PEo/QoxfkQxdZdFuZAFMsqmorvYVQa9@usduQuaTFKOo36IX76RKErtF@dNOg1ZpPhAwss8I1GrfAmj6xRG1iTU4pnErzU0R4WKxGpbQBeC/PQ/aTUV2ijGNhSUcHTdkGbW/uZKEpXxFWSe8mLlC/yli1591yOxMRUlEZIZmboyG4foPsJ@67xdOqOhcrlBFltXgUtU6diuybV9MjsQvbdOFVtt8MlX2pbd/DPRtSqcr6Q3/uEJc@yjPjoY8BpGKaIB2hgyGAcwxG0DGmbEILCDk2zAidGFuUU/gDHrm0QA/YZ5NRhfGwxfweifG0s4MT65NSs6zChcciWtixPak8jKDeI3V8EU5@skJFgj1hsuyuKo5YGWfXTsWaU8r4@8JzxTcaCz5tF9lyq3zvAYtZlGgQ5H1jyYXoodQ11if5Kj1Rv8ZL/dPI7fPEc7yZKHutN54gfAc24Lg3iHd2xS3w@D6dkhblmEX@GTprOaycPx@EdlhVz6481qMuLA/3vOelP8BQ "C++ (gcc) – Try It Online")
Following the standard calling convention for Unix-like systems (from the System V AMD64 ABI), this takes the length of the string (9) in RDI and its address in RSI, and returns a value in AL, 128 if the expression is Python 2/3 safe and 0 if not.
In assembly:
```
f:  .byte 0xB8
```
This will be explained later.
```
n:  .byte 0x66, 0x41, 0xAD
```
When jumping to `n`, the current number will be in DL.
This is a `lodsw` instruction, encoded in a strange way for reasons to be explained later. This loads two bytes from the string into AX, advancing the pointer; in particular, the operation symbol goes into AH.
```
    lodsb
```
Load another byte (a space) from the string into AL.
```
    lodsb
```
Load another byte (a digit) from the string into AL.
```
    and al, 7
```
Take the low three bits, obtaining the numerical value of the digit in AL.
```
    sahf
```
Set certain flags based on certain bits of AH, which contains the operation symbol. In particular:
```
      **PF** **CF**
+ 00101**0**1**1**
* 00101**0**1**0**
/ 00101**1**1**1**
```
```
    xchg edx, eax
```
Exchange registers.
```
    cbw
```
Sign-extend AL (previous number); this makes AH 0.
```
    jp d
```
Jump if PF=1, which is true only for `/`.
```
    jc t
```
Jump if CF is 1, which is true for `+` but not for `*`. An addition breaks a sequence of `*` and `/`, making the previous number irrelevant; the current number is correctly in DL.
Only `*` is left here.
```
    mul dl
```
Multiply AL (previous number) by DL (new digit).
```
s:  xchg edx, eax
```
Exchange registers. The product goes into DL.
```
t:  dec edi
```
(`+` joins here.) Subtract 1 from EDI.
```
    jpo n
```
Jump if the sum of the low 8 bits is odd. This is true the first two times, with 8 (1000₂) and 7 (111₂), but not true the third time, with 6 (110₂).
```
    .byte 0xB8
```
If we get here, the expression is Python 2/3 safe.
This subsumes the next two instructions into `mov eax, 0xE484F2F6`.
```
d:  div dl
```
(Recall that `/` jumps here.)
Divide AX by DL, putting the quotient in AL and the remainder in AH.
```
    test ah, ah
```
Set flags based on the value of AH.
```
    jz s
```
If the remainder is 0, jump (and next, exchange the quotient into DL and proceed).
Also, the success case joins here. In that case, the zero flag was last set by `dec edi`, which gave a nonzero result, so the jump is not taken.
```
    and al, 0x80
```
Keep the high bit of AL.
In the success case, the high bit is 1 from the `mov`.
In the failure case, AL is the quotient, which is at most 12 (from 25/2), so the high bit is 0.
```
    ret
```
Return.
---
Now, the start can be explained. The first byte 0xB8 subsumes the next four bytes into `mov eax, 0xACAD4166`. Those bytes include a `lodsw` instruction, which was encoded with a nonfunctional REX.B prefix (0x41) so that that value goes into AH. After that, the first digit is read by `lodsb`. The 0x41 value, which is in the same place as an operation symbol would be in later iterations, has a 1 in bit 0 and a 0 in bit 2, so it gets treated in the same way as a `+`, making the first digit alone become the current number.
[Answer]
# [Haskell](https://www.haskell.org/), 118 bytes
```
f.words
r=read
f(a:"/":b:t)|(q,m)<-r a`divMod`r b=m<1&&f(show q:t)
f(a:"*":b:t)=f$show(r a*r b):t
f(_:_:t)=f t
f _=1>0
```
[Try it online!](https://tio.run/##TYxLDoIwEIb3nGLSGFPwgeWxaaw38ARqsIBFIggWohvPbh0KMS4m@f7XXGV3u1SVKcTRqPWr0XnnaKEvMncUlZz4hKe8d9/0sazd7UqDPOflc9/kZw2pqLdsPle0uzYveGBt3HjjRqjZEFDceFh2eY9xwhMbAQpIBNttTC3Lu6hlu09oq8t7vy7cA2GwgAAvJEsSgAchcowcgm958CPkIQumToA6@vk@MOQYu1YjM@uP2/hvG04c2T@Yo46nP/bIyXwyVcmiM6usbb8 "Haskell – Try It Online")
Can certainly be outdone, but it's at least something. Core observation is simply that addition doesn't matter at all.
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), ~~9~~ 8 bytes
```
ḣƬ5ŒV€ĊƑ
```
[Try it online!](https://tio.run/##y0rNyan8///hjsXH1pgenRT2qGnNka5jE/8/3L3l0Najkx/uXPyoYY6Crp3Co4a5D3csOtyuGfn/v6GCtoIREBuDJEqKSlO5jBS0gDxtBVO4iLGCPlgEocYEKAJSZ4SiywgoaoKmRl/BEC5iCjQDIgoTMQTzoCanJeYUgxQhGQ0RMoYKmSCEIJr0IY6ECJmAbddHUgUA "Jelly – Try It Online")
Port of [tsh's (old) JavaScript answer.](https://codegolf.stackexchange.com/a/246634/85334)
```
ḣ 5         Take the first 5 characters
 Ƭ          repeatedly while unique.
   ŒV€      Eval each result as Python.
      ĊƑ    Are they the same if ceiled?
```
# [Jelly](https://github.com/DennisMitchell/jelly), 10 bytes
```
Ḥẹ¦”/ŒV=ŒV
```
[Try it online!](https://tio.run/##y0rNyan8///hjiUPd@08tOxRw1z9o5PCbIH4/8PdWw5tPTr54c7FjxrmKOjaKQAlH@5YdLhdM/L/f0MFbQUjIDYGSZQUlaZyGSloAXnaCqZwEWMFfbAIQo0JUASkzghFlxFQ1ARNjb6CIVzEFGgGRBQmYgjmQU1OS8wpBilCMhoiZAwVMkEIQTTpQxwJETIB266PpAoA "Jelly – Try It Online")
Have been trying to think of an *interesting* solution, but a Python eval builtin is a Python eval builtin. Was at least interesting to golf, starting from `”/=kj”/,¹ŒV€E`.
```
Ḥ             Double the characters of the input
  ¦           at indices
 ẹ ”/         of slash.
     ŒV       Concatenate and eval as Python.
       =ŒV    Is it equal to the input evaluated as Python?
```
[Answer]
# [Perl 5](https://www.perl.org/) `-p`, ~~38~~ 34 bytes
```
/. [\/*] ./;$_=(eval.eval$&)!~/\./
```
[Try it online!](https://tio.run/##Xc5LCsIwEAbgvacYoYi2JNO8VkVv4AmsSBcRhGBLU116dGMeta0uEpiPf/6k071RziKQA80RK4cUTjXmZ6BYZZf9Vj8bQ8OVbXbrF9YUnWNQAPdH@C0Y@odeccj9VICaRABGmTPSS8jxny3uVf5lENgkynck/QqL09h8bYwNoUV1IjGSnCktYfpkIhlfx0Xq3XbDrb1bR46Klqx0pDMf "Perl 5 – Try It Online")
*Simplified regex since the input format is very strict to save bytes.*
[Answer]
# [Bash](https://www.gnu.org/software/bash/), 52 bytes
Inspired by des54321's comment that said:
> 
> I'm waiting for a competitive solution to this that isnt simply "eval the string as a python expression"
> 
> 
> 
I decided to "cheat" even further by actually running both Python versions:
```
f(){ p=python;r=print\($1;$p\3<<<$r==`$p<<<$r\)`\);}
```
[Try it online!](https://tio.run/##dZAxDoIwFEB3T/HTMICENBSYCo6ewJEBJBhMDDQtDsZ49loqlhZ0IJCXx//tO9eik/LiB09gBXuM3dBTXjB@7cfS92LqsTLJ89zjRVF5TH@VQVUG9CXbphsAnfi9hbEVIzS1aAXaaRz1gGIIgagngegAiMLFQpZGYK@UELJFM8jSEsCaWdMMsrRUsel3smgGrZYSxVN3qUabaRji9TSFLC1Th/hwoxk0a@j7PtY38TcY3gbDm2DZ9orZjysmM0vdYBo5JaaF2M0/o1WJ1A1mEJJv "Bash – Try It Online")
Simplified, it's essentially just doing:
```
f() { python3 <<< "print\($0 == `python <<< print\($0\)`\)"; }
```
[Answer]
# [R](https://www.r-project.org/), ~~69~~ 68 bytes
Or **[R](https://www.r-project.org/)>=4.1, 54 bytes** by replacing two `function` occurrences with `\`s.
*Edit: -1 byte thanks to [@Dominic van Essen](https://codegolf.stackexchange.com/users/95126/dominic-van-essen).*
```
function(s,`-`=function(x)eval(parse(t=x)))-s>-paste("`/`=`%/%`;",s)
```
[Try it online!](https://tio.run/##bY7RCoMgFIbve4qDI9AtkdSuhj2LMhQG0Uba6O2dSURJF174fef855@iU9HN4yu8PyP2jaZa7d@F2J8Z8NdM3uKgFkII9T39Gh8sRppppWtW6ydqPIkOoxYewNMTiNyA9hCm2VaJc7iDSLwruACWeTkvE193@EUOT05ezjNoC96l7OyOvMpF2amoM4PfNs6XdyE2IUuRY5LsSrEeloeyWcQ/ "R – Try It Online")
Outputs inversed `TRUE`/`FALSE`.
Compares results of evaluating the expression and evaluating the expression with ``/`=`%/%`;` prepended (which redefines division to be integer division). My first approach to simply substitute `/` with `%/%` in the expression fails due to `%/%` having higher precedence than `/` and `*`.
[Answer]
# [Wolfram Language (Mathematica)](https://www.wolfram.com/wolframscript/): 24 65 Bytes
Realized my old code doesn't work, had to replace it with something more complicated. Also doesn't work on TIO.
`e="Python"~ExternalEvaluate~#&;e@StringReplace[#,"/"->"//"]==e@#&`
Uses the same trick as the 10-byte Jelly answer, but is significantly longer due to Mathematica's ExternalEvaluate taking almost 30 bytes instead of 2.
[Answer]
# [05AB1E (legacy)](https://github.com/Adriandmen/05AB1E/tree/fb4a2ce2bce6660e1a680a74dd61b72c945e6c3b), 9 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
'/x.:‚.EË
```
[Try it online](https://tio.run/##MzBNTDJM/f9fXb9Cz@pRwyw918Pd//@bKugrGCloKRgBAA) or [verify all test cases](https://tio.run/##MzBNTDJM/V9Waa@k8KhtkoKSfaXLf3X9Cj2rRw2z9FwPd//X@R@tZKigrWAExMZKOkpGCloKxkC2KZBtrKAPZoPETYBskJwRVI0RkG8CF9dXMASyTYFqwXwg2xAsDtFriqTXGMo2AZsDlAfyTaHmgLFSLAA).
**Explanation:**
Uses the legacy version of 05AB1E for two reasons:
1. It's build in Python 3, and `.E` is therefore an 'Eval as Python' builtin, whereas the new 05AB1E version is build in Elixir and `.E` is an 'Eval as Elixir' builtin.
2. Double works on strings in the legacy version of 05AB1E, so we can use `x` instead of `„//` to save 2 bytes.
**Explanation:**
```
'/        '# Push string "/"
  x        # Double it (without popping): "//"
   .:      # Replace all "/" for "//" in the (implicit) input-string
     ‚     # Pair it with the implicit input-string
      .E   # Evaluate both as Python
        Ë  # Check if the results in the pair are the same
           # (after which the result is output implicitly)
```
[Answer]
# [R](https://www.r-project.org/), ~~61~~ 59 bytes
(or 52 bytes in R≥4.1 using `\` instead of `function`)
```
function(s,t=48-s,u=t<2)!(t[1]*t[5]^(-1)^u[3]/t[9]^u[7])%%1
```
[Try it online!](https://tio.run/##dZDNCsIwEITvfYpVKSStJeSnWMF49@6tRBAxIEgrZgO@fYxVai31ENjwzUwyew9WB@ubE17ahrglalUVbuk1bgSdEay5ybAuzYEUnB58LQ3Dem3itDI0TXm4Cel0H/Cgljjt0Vb7dtdgvNMkeUnInEMOIh4JcwoLKLaAd3/@QAFZBDmUU1AC6@CkU0X4cot/sSIK1H8nAz4Fy/jeW/AD@y5s1MUer@7rHX9pSOWHqkn6TmWDRQyp6rqwsTc8AQ "R – Try It Online")
Checks 'by hand' without using `eval`. Input is list of codepoints.
---
# [R](https://www.r-project.org), 64 bytes
(or 57 bytes in R≥4.1 using `\` instead of `function`)
```
function(s,`$`=sapply)any(substring(s,1,3*2:3)$str2lang$eval%%1)
```
[Attempt This Online!](https://ato.pxeger.com/run?1=dZBNCoMwEIXp1lMM1oK_BBOFUrD0KMaiIoRUjBY8Szd24aHa0zSallqriyEw37w3eXO7V11fYiKivqkzb_84ZQ0_18WFm8KNjTgStCxZa1HemqJJRF0VPJfId4mND8QyZAczynMjvVK22_mW8nluksHV1H1wAMsioFuwBe8IddWkmoIYbAkcCJcgATTCRWUg4aDGa7ZYDgTrSgT-EgzlPjXwA7VPFjTLklEmvtr5l6aUvGmwSJUrmhxiSoMxC_rTqlN3nXpf)
`eval` approach, but different to that used by [pajonk's R answer](https://codegolf.stackexchange.com/a/246687/95126): here we check that both `"a o1 b "` and `"a o1 b o2 c"` are integers when evaluated as expressions in R, which uses `/` for floating-point division. Output is reversed (`TRUE` indicates NOT python 2/3 safe).
[Answer]
# TI-Basic, 44 [bytes](https://codegolf.meta.stackexchange.com/a/4764/98541)
```
Input Str1
"0
For(I,1,9,2
Ans+sub(Str1,I,1
End
fPart(expr(Ans)) or fPart(expr(Ans+"^0
```
* uses the same approach than [tsh's answer](https://codegolf.stackexchange.com/a/246634/98541): *The expression is "Python 2 / 3 safe" iff both `a o1 b o2 c` and `a o1 b o2 1` is integer after evaluate*
* spaces are significant in TI-Basic, they produce a `Syntax Error` if evaluated, so the loop keeps only the relevant characters (starting with an extra zero because an empty string is not possible
* `fPart` keeps the fractional part of a number
* outputs `1` for not safe and `0` for safe
[Answer]
# [Julia 1.0](http://julialang.org/), ~~46~~ 40 bytes
```
~x=eval(Meta.parse(x))%1>0
!s=~s|~s[1:5]
```
[Try it online!](https://tio.run/##XY7LCsIwEEX3/YprQUi1WtPHRmj/wC8QFyNGiIRYkipdSH@9pk19DmQxJ2fuzOWmJPG277u2FHdSbCcaWtdkrGBtFM15tQlmtuzso7N7vi0O/flqICE1jKCTklpYFgVwRTGOKGFrJRsmY4RYVQj9X22kbpRmhLLCjKJA6FPPsUTqXjaIjbmJIMXCdUsUb5IhGcnHyR0ZvPRnKnU0/3MS8DcpXIanL8LHbko@k7KD9BXtUTah/IP8UOKP9Cgftydf1hM "Julia 1.0 – Try It Online")
port of [tsh's answer](https://codegolf.stackexchange.com/a/246634/98541)
[Answer]
# [PARI/GP](https://pari.math.u-bordeaux.fr), 29 bytes
```
s->!(eval([s,Str(s"^0")])%1.)
```
[Attempt This Online!](https://ato.pxeger.com/run?1=TY9BCsIwEEWvMg4IibbWJA24sZdwWapkYaVQSkir4FncFEQ8hd7D2zhJW3QxzLz_Px_m9rTGVYeT7e8lbB_nrow3rzbOZux4MTXL22jXOdbifo284HOx4kPm8zbW1ldmIM7Auqrp6EQPCCUznEeQo4AlSBqFEaCEBSgC7UFBEiA4KYF35RSTJKQ_JwHhQVM-CB5EcMYC_V-gRkiHNoqQoKe2MFiMX_T9sL8)
A port of [tsh's JavaScript answer](https://codegolf.stackexchange.com/a/246634/9288).
---
# [PARI/GP](https://pari.math.u-bordeaux.fr), 48 bytes
```
s->eval(Str(s"=="strjoin(strsplit(s,"/"),"\\")))
```
[Attempt This Online!](https://ato.pxeger.com/run?1=TY9BCsIwEEWvMswq0ZTapAU37SVcWpEsrERKDU0UPIubgoi38B7exknaooth8v7_8yH3l9W92R_t8GigfF58k6w_K5dUh6tu2cb3zGFZovP96Ww6RtvZ1njmBKbIBdY1cs6nu7e2tr0xDUkFtjedpycGQGiY5lzAFjNYgqRRKAAlLEARFAEUpBGikxMEV84xSUL-c1LIAhSUj0KALDpTQfFfoCbIxzaKkFDMbXFwN_1iGMb9BQ)
A port of [Aiden Chow's Python answer](https://codegolf.stackexchange.com/a/246628/9288).
[Answer]
# [Retina 0.8.2](https://github.com/m-ender/retina/wiki/The-Language/a950ad7d925ec9316e3e2fb2cf5d49fd15d23e3d), 73 bytes
```
 
\d
$*
^1+\+|[+*]1+$
1(?=1*\*(1+))|\*1+
$1
+r`^(\2)+/(1+)\b
$#1$*
^1+$
```
[Try it online!](https://tio.run/##PYu9DgIxDIP3PEUkitRLhir9GREvwUY5CoKBheHEeO9e0nBisGR/tpfn5/W@9b0/NWzXXh8MjmAWrryemS7CDkD88SBUyQtP01pJdCTAS5t9jROHwesd3E5@X9e7IGNUJYhImNQVSBjMJcjqBo/WRk15YwEFim4sgRgbj/J/pM1lsEZTsa/pCw "Retina 0.8.2 – Try It Online") Link includes test cases. Edit: After reading the question more carefully, code now parses according to input rules, saving 1 byte because only digits `1`..`5` need to be supported (code actually supports `1`..`9`) but adding 3 bytes to delete spaces. Explanation:
```
 
```
Delete spaces.
```
\d
$*
```
Convert to unary.
```
^1+\+|[+*]1+$
```
Delete any additions and trailing multiplications as they have no effect.
```
1(?=1*\*(1+))|\*1+
$1
```
If there's still a multiplication left then perform it now.
```
+r`^(\2)+/(1+)\b
$#1$*
```
Perform divisions from left to right where possible.
```
^1+$
```
Check that all the divisions succeeded.
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 34 bytes
```
¹Ｎθ≡Ｓ/«Ｎζ¿﹪θζ⎚≧÷ζθ»+Ｎθ≧×Ｎθ≡Ｓ/¿﹪θＮ⎚
```
[Try it online!](https://tio.run/##jU@7DoIwFJ3lK26YimKIjwkno4sDxqg/UKFAk/JqCyYYvr1ejCbA5HYf5xmmVIYFFcZcJM81WTk765SXtT7X2YNJUuGunlyHKZDP/aYRlxDHgZcVUsXA9mwf59mQ1SJrxmMgQRHVoiCVCy0yDoJRSfofE8gMaLlXiif5lSepRnl95A2PGIJd6I27r8MCHaahIhbTWmh/qnLnGVPuCO781P4oMg49UhkW6IzZgAdrmMPWLBvxBg "Charcoal – Try It Online") Link is to verbose version of code. Allows any sized integer inputs but only two space-separated operations and outputs a Charcoal boolean i.e. `-` for safe, nothing for unsafe. Explanation:
```
¹
```
Assume that the expression is safe.
```
Ｎθ
```
Input the first integer.
```
≡Ｓ
```
Switch over the first operator.
```
/«
```
If it's a `/`, then:
```
Ｎζ
```
Input the second integer.
```
¿﹪θζ⎚
```
If the second integer does not divide the first then clear the canvas.
```
≧÷ζθ»
```
Otherwise divide the second integer by the first.
```
+Ｎθ
```
If the first operator is a `+` then ignore the first integer and input the second integer.
```
≧×Ｎθ
```
Otherwise input the second integer and multiply the first integer by it. (This case is chosen as the default case because it can't parse as an expression.)
```
≡Ｓ/
```
If the second operator is a `/`, then...
```
¿﹪θＮ⎚
```
... if the third integer does not divide the current total then clear the canvas.
[Answer]
# [MATLAB](https://www.gnu.org/software/octave/), 72 bytes
```
function p(i),eval(i);eval(regexprep(['x=' i],'(\d)','int8($1)'));ans==x
```
pretty boring, eval the string as doubles and then again as integers. If the expression is different as an integer, then yeah. I don't know python, but I can guess how it works.
[Try it online!](https://tio.run/##y08uSSxL/f8/rTQvuSQzP0@hQCNTUye1LDEHSFuD6aLU9NSKgqLUAo1o9QpbdYXMWB11jZgUTXUd9cy8EgsNFUNNdU1N68S8Ylvbiv//jQE "Octave – Try It Online")
]