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 | 1736+ Python FAQs | Share
list-comprehension | data-type | constructor | virtual-environment | debugging | copy | asyncio-module | string-iteration | sys | precedence-and-associativity | type_conversion | integer | attribute | input-function | factorial-function | format | built-in-function | context-manager | pandas | control-statement | parameter | input | method | with-statement | memory | logical-operator | exception | identifier | random-function | immutability | nested-loop | int | shallow-copy | magic-method | inheritance | append | list-indexing | function-and-scope | operator-and | version-check | list | python-module | loop | precedence | init | operator | mapping-function | import-method | def | operand | comment | iterator | loops | invalid-list | threading | set-operation | frozenset | mysql | polymorphism | min-max-function | swapping | random | keyword | sum() | map-function | dicts | stack | recurssion | zfill-function | encoding | class-and-instance-variable | string-formatting | python-history | math | scientific-notation | slice | pseudocode | while-else-loop | mathematics | encapsulation | implementation | file-handling | sum-function | namespace | python | string-method | higher-order-function | rollback | data-type | library | virtual-environment | filter | conditional-statement | indexing | feature | methods | exception-handling | choice | identity-operator | error | counter | application | functions | functional-programming | datatype | syntax-error | assert | slicing | boolean-and-non-boolean | python-django | file | variable | multiple-inheritance | input-function | string-manipulation | name-mangling | id-function | mathematical-function | tuple | static-method | assignment-operator | match | generator | zip-function | file-handling | arithmetic-operation | dictionaries | class-and-object | join | filter-function | oops | bitwise-operator | module | list-join | docstring | print-statement | inherit | pickling-&-unpickling | recursion | head-and-tail | namedtuple | classes | string-slicing | multiprocessing | datetime | binary | sorting | function | print | sorted | conversion | numpy | syntax | collection | loop-control | collections | data-structure | thread | update | counter-function | comparison | condition | exponentiation | list-comprehension | while-loop | generators | global-variable | __init_subclass__ | matrix-list-comprehension | heap-memory | raise | min-function | range | object-attribute | benefit | access-modifier | list-vs-tuple | binary-operation | list-method | matplotlib | mutable | type-conversion | multithreading | file_handling | python-repl | sys-module | installation | data-structure | odd-number | expand-tab | indentation | else-statement | turtle | set | decorator | memory-management | yield | while-and-for-loop | list-mutation | python_version | escape-operator | identity-operator | operator-overloading | exception-handling | boolean | fabs-function | zip | compute | syntaxerror | async | goto-function | array | statement | complex | string-slicing | asyncio | operations | postfix | iterable | destructor | bitwise | built-in | string-method | default-mutable-argument | round | __all__-attribute | class | for | logical-operation | complex-number | regular-expression | staticmethod | global-keyword | string-concatenation | operators | overflow | center | comprehension | bitwise-operator | touples | dictionary | lambda-function | __future__ | string | global | return-statement | lists | matrix | objects | round-function | control-flow | regex | data-structures | interpreter | command-line-parsing | oop | global-variable | expression | version | call | math-copysign | arithmetic-expression | package-management | formal-and-actual-parameter | design-principle | error-handling | function-argument | tuple-unpacking | numeric | split | built-in-function | class-and-inheritance | type-conversion | basic | software-design | max-min | enumerate() | deep-copy | typeerror | control-flow | list-operation | floating-point-precision | generators-in-python | data_structure | string-formatting | pep | descriptors | operator-or | list-slicing | lambdas | logical-operator | conditional-statement | lambda | decimal | gil | syntax-error | immutable-data-type ...