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