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


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

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