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