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