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