Timeline for Is my OS 32-bit or 64-bit?
Current License: CC BY-SA 3.0
11 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 23, 2017 at 13:19 | comment | added | bugmenot123 |
Try architecture(), saves the dict: from platform import*;print(architecture()[0][:2]) -> 50 bytes
|
|
Jun 22, 2017 at 15:53 | comment | added | Restioson |
To add to what @tOmAtE said, you could use get or: {'4':64,'6':32}.get(machine()[-1],"/") (/ just for nonemptiness). It's a bit lengthy though
|
|
Jun 22, 2017 at 9:07 | history | edited | tOmAtE | CC BY-SA 3.0 |
added 29 characters in body
|
Jun 22, 2017 at 8:04 | comment | added | Clearer | @tOmAtE if it's neither 32 nor 64 bit, it will throw an exception, which prints a non-empty string. | |
Jun 22, 2017 at 7:46 | history | edited | tOmAtE | CC BY-SA 3.0 |
added 60 characters in body; deleted 13 characters in body; deleted 7 characters in body
|
Jun 22, 2017 at 7:41 | comment | added | tOmAtE | @Clearer This would miss following constraint: Important: Print any other non-empty string of alphanumeric characters if it's neither 32 or 64 bit.. | |
Jun 21, 2017 at 10:40 | comment | added | Clearer |
from platform import*;print({'4':64,'6':32}[machine()[-1]]) would work too.
|
|
Jun 20, 2017 at 14:03 | comment | added | Jonathan Allan |
Not sure if it's acceptable because it is possible to run a 32 bit OS on a 64 bit machine (or to have some machine called a foo86 that is 64 bit :p), but if it is acceptable then you can save 9 (edit ...13!) bytes with print((a==64)*a+32*(a==86)) .
|
|
Jun 20, 2017 at 11:16 | history | edited | tOmAtE | CC BY-SA 3.0 |
Added print statement
|
Jun 20, 2017 at 9:26 | review | First posts | |||
Jun 20, 2017 at 9:34 | |||||
Jun 20, 2017 at 9:24 | history | answered | tOmAtE | CC BY-SA 3.0 |