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