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