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