Level 1 : What is the output of the following code?


file1 = open('sample.txt', r)
print(file1.readable())
print(file1.writable())

Author: anusha | Tags: file-handling | 1859+ Python FAQs | Share
exception-handling | raise-statement | membership-operators-(in,-not-in) | mysql | logical-operator | name-mangling | benefit | multiple-inheritance | __all__-attribute | list-operation | logical-operator | class | method-overloading | math | version-check | matplotlib | assert | max-min | bitwise | __future__ | string-method | min-max-function | dictionary | with-statement | asyncio | mathematical-function | data-type-conversions | matrix-list-comprehension | handling-missing-values-(fillna,-dropna) | introduction-to-python | list-methods-and-slicing | __init_subclass__ | booleans | interpreter | multiple-inheritance | lists | match | list-mutation | inheritance | introduction-to-multiprocessing | application | condition | implementation | introduction-to-threads | virtual-environment | nested-loop | array | print | asyncio-module | objects | slicing | identity-operator | python_version | string-slicing | attribute | memory | string-manipulation | debugging | syntax-error | string-iteration | reading-and-writing-files | logical-operation | oops | operator-overloading | import-method | while-and-for-loop | thread | multiple-except-blocks | version | math-copysign | iterators | multiprocessing | python-module | escape-operator | comparison | using-join()-and-is_alive()-methods | conditional-statement | managing-directories-with-os-and-shutil | bitwise-operator | string-methods | sorting-and-ranking | defining-functions | compute | identity-operators-(is,-is-not) | dicts | split | iterable | min-function | int | list | pseudocode | loop-control | filtering-and-indexing | data-structures-in-python | functional-programming | regex | higher-order-function | library | pickling--unpickling | turtle | writing:-write(),-writelines() | comprehension | thread-synchronization | functions | complex-number | python-repl | fabs-function | default-arguments | goto-function | tuples | thread-safe-data-structures-(queue.queue) | regular-expressions | tuple-unpacking | dataframe-and-series-objects | append | working-with-binary-files-(rb,-wb) | quantifiers-(*,-+,-?,-{}) | iterator | immutable-data-type | namedtuple | using-map()-for-transformations | dictionary-methods | functional-programming | access-modifier | set | error-handling | namespace | difference-between-threads-and-processes | feature | update | using-the-threading-module | id-function | class-and-object | scientific-notation | reading:-read(),-readline(),-readlines() | file_handling | using-else-and-finally | input-function | numeric | floating-point-precision | data-type | sys-module | intering | lambdas | mutable | opening-files-(open()) | head-and-tail | round | exception | staticmethod | datetime.date,-datetime.time,-datetime.datetime | using-assertions-(assertequal,-assertraises) | random-function | descriptors | while-loop | function-argument | bitwise-operator | operators | formatting-with-strftime | yield | working-with-temporary-files-using-tempfile | constructor | working-with-dates-and-times | error-handling | generators | sets | dictionaries | sorted | shallow-copy | sum-function | package-management | sorting | while-else-loop | anchors-(^,-$) | integer | join | return-statement | error | file | lambda-function | destructor | choice | collection | loops | call | def | parameter | static-method | async | string-formatting | typeerror | counter-function | basic | range | assignment-operator | deep-copy | frozenset | built-in | recursion | type_conversion | exponentiation | slice | heap-memory | while-loops | using-lists-as-stacks | stack | precedence-and-associativity | rollback | working-with-file-paths | software-design | control-flow | why-use-multiprocessing-over-threading?-(gil) | random | time-series-with-pandas | identifier | invalid-list | list,-set,-and-dictionary-comprehensions | string-slicing | list-method | pandas | indentation | zfill-function | multithreading | enumerate() | module | format | tuple-methods | unit-testing | encoding | counter | for | zip | advanced-file-operations | type-conversion-and-casting | regular-expression | pass | object-attribute | decimal | input-function | decorator | global-variable | test-discovery | using-os-and-pathlib-modules | assignment-operators | built-in-modules | type-conversion | swapping | dictionary-comprehensions | function-and-scope | collections | data_structure | lambda | using-yield-in-functions | threading | variable | arithmetic-operation | data-structure | methods | conditional-statement | generators-in-python | set-operation | round-function | raise | operations | data-structures | context-manager | creating-custom-modules | zip-function | complex | data-structure | literal-characters-and-special-characters | expression | list-join | string-method | file-handling | encapsulation | gil | aggregating-data-with-functools.reduce() | class-decorators | conditional-statements | comment | strings | function | floats | data-types | print-statement | identity-operator | arbitrary-arguments-(*args,-**kwargs) | design-principle | conversion | syntaxerror | integers | string | input | built-in-function | statement | creating-and-starting-threads | odd-number | string-formatting | touples | binary | else-statement | operator | oop | else | class-and-instance-variable | formal-and-actual-parameter | syntax | mapping-function | control-statement | string-concatenation | classes | mathematics | control-flow | boolean-and-non-boolean | list-indexing | command-line-parsing | docstring | copy | python-history | immutability | generator | syntax-error | matrix | boolean-masking | joining-and-merging-dataframes | walking-through-directories-using-os.walk() | recurssion | exception-handling | polymorphism | binary-operation | directory-operations | loop-control-statements | data-type | default-mutable-argument | arithmetic-expression | map-function | logical-operators | global-keyword | indexing | single-inheritance | datatype | filter | inherit | virtual-environment | tuple | sum() | list-slicing | type-conversion | method | sys | magic-method | list-vs-tuple | file-handling | list-comprehension | datetime | init | memory-management | loop | expand-tab | list-comprehensions | python | postfix | center | overflow | pep | python-syntax-and-structure | operand | python-operators | python-django | factorial-function | overriding-methods | global | list-comprehension | indexing:-loc-vs-iloc | operator-or | lambda-functions | installation | filter-function | global-variable | boolean | class-and-inheritance | precedence | reading-and-writing-large-files-efficiently | numpy | key-value-pairs | parsing-with-strptime | operator-and | built-in-function | keyword ...