Level 1 : How to print the pyramid shape by using the star?


def triangel(n):
    for i in range(1,n+1):
        print(" "*(n+1)+ "*"*(i))
triange(4)

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