Level 1 : What will be the output of this program?


a = '1 2'  
print(a * 2)  
print(a * 0)  
print(a * -2)

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