{"id":2947,"date":"2018-09-24T18:02:33","date_gmt":"2018-09-24T18:02:33","guid":{"rendered":"http:\/\/www.deltapci.com\/?p=2947"},"modified":"2018-09-24T18:02:33","modified_gmt":"2018-09-24T18:02:33","slug":"piramide-de-numeros-en-python","status":"publish","type":"post","link":"https:\/\/recursing-dhawan.212-132-71-197.plesk.page\/index.php\/2018\/09\/24\/piramide-de-numeros-en-python\/","title":{"rendered":"Pir\u00e1mide de N\u00fameros en Python"},"content":{"rendered":"<p>Vamos a hacer una funci\u00f3n para colocar una Pir\u00e1mide de N\u00fameros en Python , que recibe como argumento el numero de filas que tendr\u00e1 dicha pir\u00e1mide, lo resolveremos en python 3 y &nbsp;2 <!--more-->ya que la funci\u00f3n print cambia:<\/p>\n<p>Las Variables:<\/p>\n<p>j : n\u00ba de espacios en blanco<\/p>\n<p>k: n\u00ba ascendente a visualizar<\/p>\n<p>l: n\u00ba descendente a visualizar<\/p>\n<p>Para evitar que se represente el 10, utilizamos el &nbsp;resto(%) de dividir entre 10<\/p>\n<p>Pythhon 3:<\/p>\n<table style=\"border-collapse: collapse; width: 100%;\" border=\"1\">\n<tbody>\n<tr>\n<td style=\"width: 100%;\">def Piramide(lineas):<br \/>\nfila&nbsp;= 0;<br \/>\nfor i in range(1,lineas+1):<br \/>\nfila +=2;<br \/>\nfor j in range(lineas-i):<br \/>\nprint (\u00bb \u00ab,end=\u00bb\u00bb)<br \/>\nfor k in range(i,fila):<br \/>\nprint (k%10,end=\u00bb\u00bb)<br \/>\nfor l in range(fila-2,i-1,-1):<br \/>\nprint (l%10,end=\u00bb\u00bb)&nbsp; &nbsp; &nbsp; &nbsp; print ()return<\/p>\n<p>Piramide(10)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>Python 2:<br \/>\n<iframe loading=\"lazy\" src=\"https:\/\/trinket.io\/embed\/python\/a1752ebafe\" width=\"100%\" height=\"600\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Vamos a hacer una funci\u00f3n para colocar una Pir\u00e1mide de N\u00fameros en Python , que recibe como argumento el numero [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":4664,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[2],"tags":[15,3,5],"class_list":["post-2947","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutoriales","tag-piramide-de-numeros","tag-python","tag-tutoriales"],"_links":{"self":[{"href":"https:\/\/recursing-dhawan.212-132-71-197.plesk.page\/index.php\/wp-json\/wp\/v2\/posts\/2947","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/recursing-dhawan.212-132-71-197.plesk.page\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/recursing-dhawan.212-132-71-197.plesk.page\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/recursing-dhawan.212-132-71-197.plesk.page\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/recursing-dhawan.212-132-71-197.plesk.page\/index.php\/wp-json\/wp\/v2\/comments?post=2947"}],"version-history":[{"count":0,"href":"https:\/\/recursing-dhawan.212-132-71-197.plesk.page\/index.php\/wp-json\/wp\/v2\/posts\/2947\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/recursing-dhawan.212-132-71-197.plesk.page\/index.php\/wp-json\/"}],"wp:attachment":[{"href":"https:\/\/recursing-dhawan.212-132-71-197.plesk.page\/index.php\/wp-json\/wp\/v2\/media?parent=2947"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/recursing-dhawan.212-132-71-197.plesk.page\/index.php\/wp-json\/wp\/v2\/categories?post=2947"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/recursing-dhawan.212-132-71-197.plesk.page\/index.php\/wp-json\/wp\/v2\/tags?post=2947"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}