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


print('*', 'abcedf'.center(6), '*')

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