How to use imprimir method in SeleniumBase

Best Python code snippet using SeleniumBase

Semantico.py

Source:Semantico.py Github

copy

Full Screen

...12class Null(Nodo):13 def __init__(self):14 self.type = 'void'15 16 def imprimir(self,ident):17 print (ident + "Nodo Nulo") 1819 def traducir(self):20 global txt21 id = incrementar_cont()22 txt += id +"[label= "+"nodo_nulo"+"]"+"\n\t"23 24 return id252627#-------------------------------------Clases de la gramatica---------------------------------28293031class Start(Nodo):32 def __init__(self,son1,name):33 self.name = name34 self.son1 = son13536 def imprimir(self,ident):3738 self.son1.imprimir(" "+ident)3940 print (ident + "Nodo: "+self.name) 4142 def traducir(self):43 global txt44 id = incrementar_cont()45 son1 = self.son1.traducir()46 txt += id +"[label= "+self.name+"]"+"\n\t"47 txt += id +"->"+son1+"\n\t"48 return "digraph G{\n\t"+txt+"}"49 return id505152#--------------------------------------------------------------------------------------------5354class code(Nodo):5556 def __init__(self,son1,name):5758 self.name = name59 self.son1 = son1606162 def imprimir(self,ident):6364 6566 if type(self.son1) == type(tuple()):67 self.son1[0].imprimir(" "+ident)68 else: 69 self.son1.imprimir(" "+ident)7071 print (ident + "Nodo: "+self.name)727374 def traducir(self):7576 global txt77 id = incrementar_cont()787980 if type(self.son1) == type(tuple()):81 son1 = self.son1[0].traducir()82 else: 83 son1 = self.son1.traducir()848586 txt += id + "[label= "+self.name+"]"+"\n\t"87 txt += id + " -> " + son1 + "\n\t"88 return id89909192#--------------------------------------------------------------------------------------------939495class cuerpo1(Nodo):96 def __init__(self,son1,name):97 self.name = name98 self.son1 = son199 100101 def imprimir(self,ident):102 103 if type(self.son1) == type(tuple()):104 self.son1[0].imprimir(" "+ident)105 else: 106 self.son1.imprimir(" "+ident)107108 print (ident + "Nodo: "+self.name)109110111 def traducir(self):112 global txt113 id = incrementar_cont()114115 if type(self.son1) == type(tuple()):116 son1 = self.son1[0].traducir()117 else: 118 son1 = self.son1.traducir()119 120 txt += id + "[label= "+self.name+"]"+"\n\t"121 txt += id + " -> " + son1 + "\n\t"122123 return id124125126class cuerpo2(Nodo):127 def __init__(self,son1,name):128 self.name = name129 self.son1 = son1130 131132 def imprimir(self,ident):133 134 if type(self.son1) == type(tuple()):135 self.son1[0].imprimir(" "+ident)136 else: 137 self.son1.imprimir(" "+ident)138139 print (ident + "Nodo: "+self.name)140141142 def traducir(self):143 global txt144 id = incrementar_cont()145146 if type(self.son1) == type(tuple()):147 son1 = self.son1[0].traducir()148 else: 149 son1 = self.son1.traducir()150 151 txt += id + "[label= "+self.name+"]"+"\n\t"152 txt += id + " -> " + son1 + "\n\t"153154 return id155156class cuerpo3(Nodo):157 def __init__(self,son1,name):158 self.name = name159 self.son1 = son1160 161162 def imprimir(self,ident):163 164 if type(self.son1) == type(tuple()):165 self.son1[0].imprimir(" "+ident)166 else: 167 self.son1.imprimir(" "+ident)168169 print (ident + "Nodo: "+self.name)170171172 def traducir(self):173 global txt174 id = incrementar_cont()175176 if type(self.son1) == type(tuple()):177 son1 = self.son1[0].traducir()178 else: 179 son1 = self.son1.traducir()180 181 txt += id + "[label= "+self.name+"]"+"\n\t"182 txt += id + " -> " + son1 + "\n\t"183184 return id185186class cuerpo_if2(Nodo):187 def __init__(self,son1,name):188 self.name = name189 self.son1 = son1190 191192 def imprimir(self,ident):193 194 if type(self.son1) == type(tuple()):195 self.son1[0].imprimir(" "+ident)196 else: 197 self.son1.imprimir(" "+ident)198199 print (ident + "Nodo: "+self.name)200201202 def traducir(self):203 global txt204 id = incrementar_cont()205206 if type(self.son1) == type(tuple()):207 son1 = self.son1[0].traducir()208 else: 209 son1 = self.son1.traducir()210 211 txt += id + "[label= "+self.name+"]"+"\n\t"212 txt += id + " -> " + son1 + "\n\t"213214 return id215216class expresion_if(Nodo):217 def __init__(self,son1, son2, name):218 self.name = name219 self.son1 = son1220 self.son2 = son2221 222223 def imprimir(self,ident):224 225 if type(self.son1) == type(tuple()):226 self.son1[0].imprimir(" "+ident)227 else: 228 self.son1.imprimir(" "+ident)229230 if type(self.son2) == type(tuple()):231 self.son2[0].imprimir(" "+ident)232 else: 233 self.son2.imprimir(" "+ident)234235 print (ident + "Nodo: "+self.name)236237238 def traducir(self):239 global txt240 id = incrementar_cont()241242 if type(self.son1) == type(tuple()):243 son1 = self.son1[0].traducir()244 else: 245 son1 = self.son1.traducir()246 247 if type(self.son2) == type(tuple()):248 son2 = self.son2[0].traducir()249 else: 250 son2 = self.son2.traducir()251 252 txt += id + "[label= "+self.name+"]"+"\n\t"253 txt += id + " -> " + son1 + "\n\t"254 txt += id + " -> " + son2 + "\n\t"255256 return id257258class funcion_if1(Nodo):259 def __init__(self,son1, son2, name):260 self.name = name261 self.son1 = son1262 self.son2 = son2263 264265 def imprimir(self,ident):266 267 if type(self.son1) == type(tuple()):268 self.son1[0].imprimir(" "+ident)269 else: 270 self.son1.imprimir(" "+ident)271272 if type(self.son2) == type(tuple()):273 self.son2[0].imprimir(" "+ident)274 else: 275 self.son2.imprimir(" "+ident)276277 print (ident + "Nodo: "+self.name)278279280 def traducir(self):281 global txt282 id = incrementar_cont()283284 if type(self.son1) == type(tuple()):285 son1 = self.son1[0].traducir()286 else: 287 son1 = self.son1.traducir()288 289 if type(self.son2) == type(tuple()):290 son2 = self.son2[0].traducir()291 else: 292 son2 = self.son2.traducir()293 294 txt += id + "[label= "+self.name+"]"+"\n\t"295 txt += id + " -> " + son1 + "\n\t"296 txt += id + " -> " + son2 + "\n\t"297298 return id299300class funcion_if2(Nodo):301 def __init__(self,son1, son2, name):302 self.name = name303 self.son1 = son1304 self.son2 = son2305 306307 def imprimir(self,ident):308 309 if type(self.son1) == type(tuple()):310 self.son1[0].imprimir(" "+ident)311 else: 312 self.son1.imprimir(" "+ident)313314 if type(self.son2) == type(tuple()):315 self.son2[0].imprimir(" "+ident)316 else: 317 self.son2.imprimir(" "+ident)318319 print (ident + "Nodo: "+self.name)320321322 def traducir(self):323 global txt324 id = incrementar_cont()325326 if type(self.son1) == type(tuple()):327 son1 = self.son1[0].traducir()328 else: 329 son1 = self.son1.traducir()330 331 if type(self.son2) == type(tuple()):332 son2 = self.son2[0].traducir()333 else: 334 son2 = self.son2.traducir()335 336 txt += id + "[label= "+self.name+"]"+"\n\t"337 txt += id + " -> " + son1 + "\n\t"338 txt += id + " -> " + son2 + "\n\t"339340 return id341342class funcion_if3(Nodo):343 def __init__(self,son1, son2, name):344 self.name = name345 self.son1 = son1346 self.son2 = son2347 348349 def imprimir(self,ident):350 351 if type(self.son1) == type(tuple()):352 self.son1[0].imprimir(" "+ident)353 else: 354 self.son1.imprimir(" "+ident)355356 if type(self.son2) == type(tuple()):357 self.son2[0].imprimir(" "+ident)358 else: 359 self.son2.imprimir(" "+ident)360361 print (ident + "Nodo: "+self.name)362363364 def traducir(self):365 global txt366 id = incrementar_cont()367368 if type(self.son1) == type(tuple()):369 son1 = self.son1[0].traducir()370 else: 371 son1 = self.son1.traducir()372 373 if type(self.son2) == type(tuple()):374 son2 = self.son2[0].traducir()375 else: 376 son2 = self.son2.traducir()377 378 txt += id + "[label= "+self.name+"]"+"\n\t"379 txt += id + " -> " + son1 + "\n\t"380 txt += id + " -> " + son2 + "\n\t"381382 return id383384class funcion_if4(Nodo):385 def __init__(self,son1, son2, name):386 self.name = name387 self.son1 = son1388 self.son2 = son2389 390391 def imprimir(self,ident):392 393 if type(self.son1) == type(tuple()):394 self.son1[0].imprimir(" "+ident)395 else: 396 self.son1.imprimir(" "+ident)397398 if type(self.son2) == type(tuple()):399 self.son2[0].imprimir(" "+ident)400 else: 401 self.son2.imprimir(" "+ident)402403 print (ident + "Nodo: "+self.name)404405406 def traducir(self):407 global txt408 id = incrementar_cont()409410 if type(self.son1) == type(tuple()):411 son1 = self.son1[0].traducir()412 else: 413 son1 = self.son1.traducir()414 415 if type(self.son2) == type(tuple()):416 son2 = self.son2[0].traducir()417 else: 418 son2 = self.son2.traducir()419 420 txt += id + "[label= "+self.name+"]"+"\n\t"421 txt += id + " -> " + son1 + "\n\t"422 txt += id + " -> " + son2 + "\n\t"423424 return id425426#--------------------------------------------------------------------------------------------427428429class Variable1(Nodo):430 def __init__(self,son1,son2,name):431 self.name = name432 self.son1 = son1433 self.son2 = son2434435 436437 def imprimir(self,ident):438 if type(self.son1) == type(tuple()):439 self.son1[0].imprimir(" "+ident)440 else:441 self.son1.imprimir(" "+ident)442 443 if type(self.son2) == type(tuple()):444 self.son2[0].imprimir(" "+ident)445 else: 446 self.son2.imprimir(" "+ident)447448 print(ident+"Nodo: "+self.name)449450451452 def traducir(self):453 global txt454 id = incrementar_cont()455456 if type(self.son1) == type(tuple()):457 son1 = self.son1[0].traducir()458 else: 459 son1 = self.son1.traducir()460461 if type(self.son2) == type(tuple()):462 son2 = self.son2[0].traducir()463 else: 464 son2 = self.son2.traducir()465466 txt += id + "[label= "+self.name+"]"+"\n\t"467 txt += id + " -> " + son1 + "\n\t"468 txt += id + " -> " + son2 + "\n\t"469470 return id471472473474class Variable2(Nodo):475 def __init__(self,son1,son2,name):476 self.name = name477 self.son1 = son1478 self.son2 = son2479480 481482 def imprimir(self,ident):483 if type(self.son1) == type(tuple()):484 self.son1[0].imprimir(" "+ident)485 else:486 self.son1.imprimir(" "+ident)487 488 if type(self.son2) == type(tuple()):489 self.son2[0].imprimir(" "+ident)490 else: 491 self.son2.imprimir(" "+ident)492493 print(ident+"Nodo: "+self.name)494495496497 def traducir(self):498 global txt499 id = incrementar_cont()500501 if type(self.son1) == type(tuple()):502 son1 = self.son1[0].traducir()503 else: 504 son1 = self.son1.traducir()505506 if type(self.son2) == type(tuple()):507 son2 = self.son2[0].traducir()508 else: 509 son2 = self.son2.traducir()510511 txt += id + "[label= "+self.name+"]"+"\n\t"512 txt += id + " -> " + son1 + "\n\t"513 txt += id + " -> " + son2 + "\n\t"514515 return id516517518519class VariableDef1(Nodo):520 def __init__(self,son1,son2,son3,name):521 self.name = name522 self.son1 = son1523 self.son2 = son2524 self.son3 = son3525 526527 def imprimir(self,ident):528 self.son1.imprimir(" "+ident)529 self.son2.imprimir(" "+ident)530 self.son3.imprimir(" "+ident)531532 print(ident+"Nodo: "+self.name)533534535 def traducir(self):536 global txt537 id = incrementar_cont()538539 son1 = self.son1.traducir()540 son2 = self.son2.traducir()541 son3 = self.son3.traducir()542 543544 txt += id + "[label= "+self.name+"]"+"\n\t"545 txt += id + " -> " + son1 + "\n\t"546 txt += id + " -> " + son2 + "\n\t"547 txt += id + " -> " + son3 + "\n\t"548549 return id550551552class VariableDef2_1(Nodo):553554 def __init__(self,son1,son2,son3,son4,son5,name):555 self.name = name556 self.son1 = son1557 self.son2 = son2558 self.son3 = son3559 self.son4 = son4560 self.son5 = son5561 562563564 def imprimir(self,ident):565 self.son1.imprimir(" "+ident)566 self.son2.imprimir(" "+ident)567 self.son3.imprimir(" "+ident)568569 if type(self.son4) == type(tuple()):570 self.son4[0].imprimir(" "+ident)571 else:572 self.son4.imprimir(" "+ident)573574 self.son5.imprimir(" "+ident)575576577 print (ident + "Nodo: "+self.name)578 579 def traducir(self):580 global txt581 id = incrementar_cont()582583 son1 = self.son1.traducir()584 son2 = self.son2.traducir()585 son3 = self.son3.traducir()586587 if type(self.son4) == type(tuple()):588 son4 = self.son4[0].traducir()589 else: 590 son4 = self.son4.traducir()591 son5 = self.son5.traducir()592593 txt += id + "[label= "+self.name+"]"+"\n\t"594 txt += id + " -> " + son1 + "\n\t"595 txt += id + " -> " + son2 + "\n\t"596 txt += id + " -> " + son3 + "\n\t"597 txt += id + " -> " + son4 + "\n\t"598 txt += id + " -> " + son5 + "\n\t"599600 return id601602603604class VariableDef2_2(Nodo):605606 def __init__(self,son1,son2,son3,son4,son5,name):607 self.name = name608 self.son1 = son1609 self.son2 = son2610 self.son3 = son3611 self.son4 = son4612 self.son5 = son5613 614615616 def imprimir(self,ident):617 self.son1.imprimir(" "+ident)618 self.son2.imprimir(" "+ident)619 self.son3.imprimir(" "+ident)620621 if type(self.son4) == type(tuple()):622 self.son4[0].imprimir(" "+ident)623 else:624 self.son4.imprimir(" "+ident)625626 self.son5.imprimir(" "+ident)627628629 print (ident + "Nodo: "+self.name)630 631 def traducir(self):632 global txt633 id = incrementar_cont()634635 son1 = self.son1.traducir()636 son2 = self.son2.traducir()637 son3 = self.son3.traducir()638639 if type(self.son4) == type(tuple()):640 son4 = self.son4[0].traducir()641 else: 642 son4 = self.son4.traducir()643 son5 = self.son5.traducir()644645 txt += id + "[label= "+self.name+"]"+"\n\t"646 txt += id + " -> " + son1 + "\n\t"647 txt += id + " -> " + son2 + "\n\t"648 txt += id + " -> " + son3 + "\n\t"649 txt += id + " -> " + son4 + "\n\t"650 txt += id + " -> " + son5 + "\n\t"651652 return id653654655656class VariableDef2_3(Nodo):657658 def __init__(self,son1,son2,son3,son4,son5,name):659 self.name = name660 self.son1 = son1661 self.son2 = son2662 self.son3 = son3663 self.son4 = son4664 self.son5 = son5665 666667668 def imprimir(self,ident):669 self.son1.imprimir(" "+ident)670 self.son2.imprimir(" "+ident)671 self.son3.imprimir(" "+ident)672673 if type(self.son4) == type(tuple()):674 self.son4[0].imprimir(" "+ident)675 else:676 self.son4.imprimir(" "+ident)677678 self.son5.imprimir(" "+ident)679680681 print (ident + "Nodo: "+self.name)682 683 def traducir(self):684 global txt685 id = incrementar_cont()686687 son1 = self.son1.traducir()688 son2 = self.son2.traducir()689 son3 = self.son3.traducir()690691 if type(self.son4) == type(tuple()):692 son4 = self.son4[0].traducir()693 else: 694 son4 = self.son4.traducir()695 son5 = self.son5.traducir()696697 txt += id + "[label= "+self.name+"]"+"\n\t"698 txt += id + " -> " + son1 + "\n\t"699 txt += id + " -> " + son2 + "\n\t"700 txt += id + " -> " + son3 + "\n\t"701 txt += id + " -> " + son4 + "\n\t"702 txt += id + " -> " + son5 + "\n\t"703704 return id705706#--------------------------------------------------------------------------------------------707708class expresion1(Nodo):709 def __init__(self,son1,son2,name):710 self.name = name711 self.son1 = son1712 self.son2 = son2713714 def imprimir(self,ident):715716 self.son1.imprimir(" "+ident)717718 if type(self.son2) == type(tuple()):719 self.son2[0].imprimir(" "+ident)720 else: 721 self.son2.imprimir(" "+ident)722723 print (ident + "Nodo: "+self.name)724725726 def traducir(self):727 global txt728 id = incrementar_cont()729730 731 son1 = self.son1.traducir()732733 if type(self.son2) == type(tuple()):734 son2 = self.son2[0].traducir()735 else: 736 son2 = self.son2.traducir()737738 txt += id + "[label= "+self.name+"]"+"\n\t"739 txt += id + " -> " + son1 + "\n\t"740 txt += id + " -> " + son2 + "\n\t"741742 return id743744745746class expresion2(Nodo):747 def __init__(self,son1,son2,name):748 self.name = name749 self.son1 = son1750 self.son2 = son2751752 def imprimir(self,ident):753754755 self.son1.imprimir(" "+ident)756 757 if type(self.son2) == type(tuple()):758 self.son2[0].imprimir(" "+ident)759 else: 760 self.son2.imprimir(" "+ident)761762 print (ident + "Nodo: "+self.name)763764765 def traducir(self):766 global txt767 id = incrementar_cont()768769 770 son1 = self.son1.traducir()771772 if type(self.son2) == type(tuple()):773 son2 = self.son2[0].traducir()774 else: 775 son2 = self.son2.traducir()776777 txt += id + "[label= "+self.name+"]"+"\n\t"778 txt += id + " -> " + son1 + "\n\t"779 txt += id + " -> " + son2 + "\n\t"780781 return id782783784class expresion3(Nodo):785 def __init__(self,son1,son2,name):786 self.name = name787 self.son1 = son1788 self.son2 = son2789790 def imprimir(self,ident):791792 if type(self.son1) == type(tuple()):793 self.son1[0].imprimir(" "+ident)794 else:795 self.son1.imprimir(" "+ident)796 797 if type(self.son2) == type(tuple()):798 self.son2[0].imprimir(" "+ident)799 else: 800 self.son2.imprimir(" "+ident)801802 print (ident + "Nodo: "+self.name)803804805 def traducir(self):806 global txt807 id = incrementar_cont()808809 if type(self.son1) == type(tuple()):810 son1 = self.son1[0].traducir()811 else: 812 son1 = self.son1.traducir()813814 if type(self.son2) == type(tuple()):815 son2 = self.son2[0].traducir()816 else: 817 son2 = self.son2.traducir()818819 txt += id + "[label= "+self.name+"]"+"\n\t"820 txt += id + " -> " + son1 + "\n\t"821 txt += id + " -> " + son2 + "\n\t"822823 return id824825class expresion4(Nodo):826 def __init__(self,son1,son2,name):827 self.name = name828 self.son1 = son1829 self.son2 = son2830831 def imprimir(self,ident):832833 834 self.son1.imprimir(" "+ident)835 836 if type(self.son2) == type(tuple()):837 self.son2[0].imprimir(" "+ident)838 else: 839 self.son2.imprimir(" "+ident)840841 print (ident + "Nodo: "+self.name)842843844 def traducir(self):845 global txt846 id = incrementar_cont()847848 849 son1 = self.son1.traducir()850851 if type(self.son2) == type(tuple()):852 son2 = self.son2[0].traducir()853 else: 854 son2 = self.son2.traducir()855856 txt += id + "[label= "+self.name+"]"+"\n\t"857 txt += id + " -> " + son1 + "\n\t"858 txt += id + " -> " + son2 + "\n\t"859860 return id861862863864class expresion5(Nodo):865 def __init__(self,son1,son2,name):866 self.name = name867 self.son1 = son1868 self.son2 = son2869870 def imprimir(self,ident):871872 if type(self.son1) == type(tuple()):873 self.son1[0].imprimir(" "+ident)874 else:875 self.son1.imprimir(" "+ident)876 877 if type(self.son2) == type(tuple()):878 self.son2[0].imprimir(" "+ident)879 else: 880 self.son2.imprimir(" "+ident)881882 print (ident + "Nodo: "+self.name)883884885 def traducir(self):886 global txt887 id = incrementar_cont()888889 if type(self.son1) == type(tuple()):890 son1 = self.son1[0].traducir()891 else: 892 son1 = self.son1.traducir()893894 if type(self.son2) == type(tuple()):895 son2 = self.son2[0].traducir()896 else: 897 son2 = self.son2.traducir()898899 txt += id + "[label= "+self.name+"]"+"\n\t"900 txt += id + " -> " + son1 + "\n\t"901 txt += id + " -> " + son2 + "\n\t"902903 return id904905906907class expresion6(Nodo):908 def __init__(self,son1,son2,name):909 self.name = name910 self.son1 = son1911 self.son2 = son2912913 def imprimir(self,ident):914915 if type(self.son1) == type(tuple()):916 self.son1[0].imprimir(" "+ident)917 else:918 self.son1.imprimir(" "+ident)919 920921 print (ident + "Nodo: "+self.name)922923924 def traducir(self):925 global txt926 id = incrementar_cont()927928 if type(self.son1) == type(tuple()):929 son1 = self.son1[0].traducir()930 else: 931 son1 = self.son1.traducir()932933 txt += id + "[label= "+self.name+"]"+"\n\t"934 txt += id + " -> " + son1 + "\n\t"935 936937 return id938939940941class expresion7(Nodo):942 def __init__(self,son1,name):943 self.name = name944 self.son1 = son1945946947 def imprimir(self,ident):948949 if type(self.son1) == type(tuple()):950 self.son1[0].imprimir(" "+ident)951 else:952 self.son1.imprimir(" "+ident)953 954955 print (ident + "Nodo: "+self.name)956957958 def traducir(self):959 global txt960 id = incrementar_cont()961962 if type(self.son1) == type(tuple()):963 son1 = self.son1[0].traducir()964 else: 965 son1 = self.son1.traducir()966967 txt += id + "[label= "+self.name+"]"+"\n\t"968 txt += id + " -> " + son1 + "\n\t"969 970971 return id972#--------------------------------------------------------------------------------------------973974class operador1(Nodo):975976 def __init__(self,son1,name):977 self.name = name978 self.son1 = son1979980981 982 def imprimir(self,ident):983 self.son1.imprimir(" "+ident)984985 print(ident+"Nodo: "+self.name)986987988 def traducir(self):989 global txt990 id = incrementar_cont()991992 son1 = self.son1.traducir()993994 txt += id + "[label= "+self.name+"]"+"\n\t"995 txt += id + " -> " + son1 + "\n\t"996 997998 return id9991000class operador2(Nodo):10011002 def __init__(self,son1,name):1003 self.name = name1004 self.son1 = son1100510061007 1008 def imprimir(self,ident):1009 self.son1.imprimir(" "+ident)10101011 print(ident+"Nodo: "+self.name)101210131014 def traducir(self):1015 global txt1016 id = incrementar_cont()10171018 son1 = self.son1.traducir()10191020 txt += id + "[label= "+self.name+"]"+"\n\t"1021 txt += id + " -> " + son1 + "\n\t"1022 10231024 return id1025102610271028class operador3(Nodo):10291030 def __init__(self,son1,name):1031 self.name = name1032 self.son1 = son1103310341035 1036 def imprimir(self,ident):1037 self.son1.imprimir(" "+ident)10381039 print(ident+"Nodo: "+self.name)104010411042 def traducir(self):1043 global txt1044 id = incrementar_cont()10451046 son1 = self.son1.traducir()10471048 txt += id + "[label= "+self.name+"]"+"\n\t"1049 txt += id + " -> " + son1 + "\n\t"1050 10511052 return id105310541055class operador4(Nodo):10561057 def __init__(self,son1,name):1058 self.name = name1059 self.son1 = son1106010611062 1063 def imprimir(self,ident):1064 self.son1.imprimir(" "+ident)10651066 print(ident+"Nodo: "+self.name)106710681069 def traducir(self):1070 global txt1071 id = incrementar_cont()10721073 son1 = self.son1.traducir()10741075 txt += id + "[label= "+self.name+"]"+"\n\t"1076 txt += id + " -> " + son1 + "\n\t"1077 10781079 return id108010811082class operador5(Nodo):10831084 def __init__(self,son1,name):1085 self.name = name1086 self.son1 = son1108710881089 1090 def imprimir(self,ident):1091 self.son1.imprimir(" "+ident)10921093 print(ident+"Nodo: "+self.name)109410951096 def traducir(self):1097 global txt1098 id = incrementar_cont()10991100 son1 = self.son1.traducir()11011102 txt += id + "[label= "+self.name+"]"+"\n\t"1103 txt += id + " -> " + son1 + "\n\t"1104 11051106 return id11071108 1109#--------------------------------------------------------------------------------------------111011111112class funcion1(Nodo):11131114 def __init__(self,son1,name):1115 self.name = name1116 self.son1 = son1111711181119 1120 def imprimir(self,ident):11211122 if type(self.son1) == type(tuple()):1123 self.son1[0].imprimir(" "+ident)1124 else:1125 self.son1.imprimir(" "+ident)11261127 print(ident+"Nodo: "+self.name)112811291130 def traducir(self):1131 global txt1132 id = incrementar_cont()11331134 if type(self.son1) == type(tuple()):1135 son1 = self.son1[0].traducir()1136 else: 1137 son1 = self.son1.traducir()11381139 txt += id + "[label= "+self.name+"]"+"\n\t"1140 txt += id + " -> " + son1 + "\n\t"1141 11421143 return id1144114511461147class funcion2(Nodo):11481149 def __init__(self,son1,name):1150 self.name = name1151 self.son1 = son1115211531154 1155 def imprimir(self,ident):11561157 if type(self.son1) == type(tuple()):1158 self.son1[0].imprimir(" "+ident)1159 else:1160 self.son1.imprimir(" "+ident)11611162 print(ident+"Nodo: "+self.name)116311641165 def traducir(self):1166 global txt1167 id = incrementar_cont()11681169 if type(self.son1) == type(tuple()):1170 son1 = self.son1[0].traducir()1171 else: 1172 son1 = self.son1.traducir()11731174 txt += id + "[label= "+self.name+"]"+"\n\t"1175 txt += id + " -> " + son1 + "\n\t"1176 11771178 return id117911801181class funcion3(Nodo):11821183 def __init__(self,son1,name):1184 self.name = name1185 self.son1 = son1118611871188 1189 def imprimir(self,ident):11901191 if type(self.son1) == type(tuple()):1192 self.son1[0].imprimir(" "+ident)1193 else:1194 self.son1.imprimir(" "+ident)11951196 print(ident+"Nodo: "+self.name)119711981199 def traducir(self):1200 global txt1201 id = incrementar_cont()12021203 if type(self.son1) == type(tuple()):1204 son1 = self.son1[0].traducir()1205 else: 1206 son1 = self.son1.traducir()12071208 txt += id + "[label= "+self.name+"]"+"\n\t"1209 txt += id + " -> " + son1 + "\n\t"1210 12111212 return id1213121412151216class funcion4(Nodo):12171218 def __init__(self,son1,name):1219 self.name = name1220 self.son1 = son1122112221223 1224 def imprimir(self,ident):12251226 if type(self.son1) == type(tuple()):1227 self.son1[0].imprimir(" "+ident)1228 else:1229 self.son1.imprimir(" "+ident)12301231 print(ident+"Nodo: "+self.name)123212331234 def traducir(self):1235 global txt1236 id = incrementar_cont()12371238 if type(self.son1) == type(tuple()):1239 son1 = self.son1[0].traducir()1240 else: 1241 son1 = self.son1.traducir()12421243 txt += id + "[label= "+self.name+"]"+"\n\t"1244 txt += id + " -> " + son1 + "\n\t"1245 12461247 return id1248124912501251class funcion5(Nodo):12521253 def __init__(self,son1,name):1254 self.name = name1255 self.son1 = son1125612571258 1259 def imprimir(self,ident):12601261 if type(self.son1) == type(tuple()):1262 self.son1[0].imprimir(" "+ident)1263 else:1264 self.son1.imprimir(" "+ident)12651266 print(ident+"Nodo: "+self.name)126712681269 def traducir(self):1270 global txt1271 id = incrementar_cont()12721273 if type(self.son1) == type(tuple()):1274 son1 = self.son1[0].traducir()1275 else: 1276 son1 = self.son1.traducir()12771278 txt += id + "[label= "+self.name+"]"+"\n\t"1279 txt += id + " -> " + son1 + "\n\t"1280 12811282 return id1283128412851286class funcion6(Nodo):12871288 def __init__(self,son1,name):1289 self.name = name1290 self.son1 = son1129112921293 1294 def imprimir(self,ident):12951296 if type(self.son1) == type(tuple()):1297 self.son1[0].imprimir(" "+ident)1298 else:1299 self.son1.imprimir(" "+ident)13001301 print(ident+"Nodo: "+self.name)130213031304 def traducir(self):1305 global txt1306 id = incrementar_cont()13071308 if type(self.son1) == type(tuple()):1309 son1 = self.son1[0].traducir()1310 else: 1311 son1 = self.son1.traducir()13121313 txt += id + "[label= "+self.name+"]"+"\n\t"1314 txt += id + " -> " + son1 + "\n\t"1315 13161317 return id 131813191320132113221323class funcion7(Nodo):13241325 def __init__(self,son1,name):1326 self.name = name1327 self.son1 = son1132813291330 1331 def imprimir(self,ident):13321333 if type(self.son1) == type(tuple()):1334 self.son1[0].imprimir(" "+ident)1335 else:1336 self.son1.imprimir(" "+ident)13371338 print(ident+"Nodo: "+self.name)133913401341 def traducir(self):1342 global txt1343 id = incrementar_cont()13441345 if type(self.son1) == type(tuple()):1346 son1 = self.son1[0].traducir()1347 else: 1348 son1 = self.son1.traducir()13491350 txt += id + "[label= "+self.name+"]"+"\n\t"1351 txt += id + " -> " + son1 + "\n\t"1352 13531354 return id135513561357class funcion8(Nodo):13581359 def __init__(self,son1,name):1360 self.name = name1361 self.son1 = son1136213631364 1365 def imprimir(self,ident):13661367 if type(self.son1) == type(tuple()):1368 self.son1[0].imprimir(" "+ident)1369 else:1370 self.son1.imprimir(" "+ident)13711372 print(ident+"Nodo: "+self.name)137313741375 def traducir(self):1376 global txt1377 id = incrementar_cont()13781379 if type(self.son1) == type(tuple()):1380 son1 = self.son1[0].traducir()1381 else: 1382 son1 = self.son1.traducir()13831384 txt += id + "[label= "+self.name+"]"+"\n\t"1385 txt += id + " -> " + son1 + "\n\t"1386 13871388 return id13891390class funcion9(Nodo):13911392 def __init__(self,son1,name):1393 self.name = name1394 self.son1 = son1139513961397 1398 def imprimir(self,ident):13991400 if type(self.son1) == type(tuple()):1401 self.son1[0].imprimir(" "+ident)1402 else:1403 self.son1.imprimir(" "+ident)14041405 print(ident+"Nodo: "+self.name)140614071408 def traducir(self):1409 global txt1410 id = incrementar_cont()14111412 if type(self.son1) == type(tuple()):1413 son1 = self.son1[0].traducir()1414 else: 1415 son1 = self.son1.traducir()14161417 txt += id + "[label= "+self.name+"]"+"\n\t"1418 txt += id + " -> " + son1 + "\n\t"1419 14201421 return id142214231424#--------------------------------------------------------------------------------------------1425class condicion1(Nodo):1426 def __init__(self,son1,son2,name):1427 self.name = name1428 self.son1 = son11429 self.son2 = son214301431 def imprimir(self,ident):14321433 if type(self.son1) == type(tuple()):1434 self.son1[0].imprimir(" "+ident)1435 else:1436 self.son1.imprimir(" "+ident)1437 1438 if type(self.son2) == type(tuple()):1439 self.son2[0].imprimir(" "+ident)1440 else: 1441 self.son2.imprimir(" "+ident)14421443 print (ident + "Nodo: "+self.name)144414451446 def traducir(self):1447 global txt1448 id = incrementar_cont()14491450 if type(self.son1) == type(tuple()):1451 son1 = self.son1[0].traducir()1452 else: 1453 son1 = self.son1.traducir()14541455 if type(self.son2) == type(tuple()):1456 son2 = self.son2[0].traducir()1457 else: 1458 son2 = self.son2.traducir()14591460 txt += id + "[label= "+self.name+"]"+"\n\t"1461 txt += id + " -> " + son1 + "\n\t"1462 txt += id + " -> " + son2 + "\n\t"14631464 return id146514661467class condicion2(Nodo):1468 def __init__(self,son1,son2,name):1469 self.name = name1470 self.son1 = son11471 self.son2 = son214721473 def imprimir(self,ident):14741475 if type(self.son1) == type(tuple()):1476 self.son1[0].imprimir(" "+ident)1477 else:1478 self.son1.imprimir(" "+ident)1479 1480 if type(self.son2) == type(tuple()):1481 self.son2[0].imprimir(" "+ident)1482 else: 1483 self.son2.imprimir(" "+ident)14841485 print (ident + "Nodo: "+self.name)148614871488 def traducir(self):1489 global txt1490 id = incrementar_cont()14911492 if type(self.son1) == type(tuple()):1493 son1 = self.son1[0].traducir()1494 else: 1495 son1 = self.son1.traducir()14961497 if type(self.son2) == type(tuple()):1498 son2 = self.son2[0].traducir()1499 else: 1500 son2 = self.son2.traducir()15011502 txt += id + "[label= "+self.name+"]"+"\n\t"1503 txt += id + " -> " + son1 + "\n\t"1504 txt += id + " -> " + son2 + "\n\t"15051506 return id150715081509class condicion3(Nodo):1510 def __init__(self,son1,son2,name):1511 self.name = name1512 self.son1 = son11513 self.son2 = son215141515 def imprimir(self,ident):15161517 if type(self.son1) == type(tuple()):1518 self.son1[0].imprimir(" "+ident)1519 else:1520 self.son1.imprimir(" "+ident)1521 1522 if type(self.son2) == type(tuple()):1523 self.son2[0].imprimir(" "+ident)1524 else: 1525 self.son2.imprimir(" "+ident)15261527 print (ident + "Nodo: "+self.name)152815291530 def traducir(self):1531 global txt1532 id = incrementar_cont()15331534 if type(self.son1) == type(tuple()):1535 son1 = self.son1[0].traducir()1536 else: 1537 son1 = self.son1.traducir()15381539 if type(self.son2) == type(tuple()):1540 son2 = self.son2[0].traducir()1541 else: 1542 son2 = self.son2.traducir()15431544 txt += id + "[label= "+self.name+"]"+"\n\t"1545 txt += id + " -> " + son1 + "\n\t"1546 txt += id + " -> " + son2 + "\n\t"15471548 return id15491550class condicion4(Nodo):1551 def __init__(self,son1,son2,name):1552 self.name = name1553 self.son1 = son11554 self.son2 = son215551556 def imprimir(self,ident):15571558 if type(self.son1) == type(tuple()):1559 self.son1[0].imprimir(" "+ident)1560 else:1561 self.son1.imprimir(" "+ident)1562 1563 if type(self.son2) == type(tuple()):1564 self.son2[0].imprimir(" "+ident)1565 else: 1566 self.son2.imprimir(" "+ident)15671568 print (ident + "Nodo: "+self.name)156915701571 def traducir(self):1572 global txt1573 id = incrementar_cont()15741575 if type(self.son1) == type(tuple()):1576 son1 = self.son1[0].traducir()1577 else: 1578 son1 = self.son1.traducir()15791580 if type(self.son2) == type(tuple()):1581 son2 = self.son2[0].traducir()1582 else: 1583 son2 = self.son2.traducir()15841585 txt += id + "[label= "+self.name+"]"+"\n\t"1586 txt += id + " -> " + son1 + "\n\t"1587 txt += id + " -> " + son2 + "\n\t"15881589 return id15901591class condicion5(Nodo):1592 def __init__(self,son1,son2,name):1593 self.name = name1594 self.son1 = son11595 self.son2 = son215961597 def imprimir(self,ident):15981599 if type(self.son1) == type(tuple()):1600 self.son1[0].imprimir(" "+ident)1601 else:1602 self.son1.imprimir(" "+ident)1603 1604 if type(self.son2) == type(tuple()):1605 self.son2[0].imprimir(" "+ident)1606 else: 1607 self.son2.imprimir(" "+ident)16081609 print (ident + "Nodo: "+self.name)161016111612 def traducir(self):1613 global txt1614 id = incrementar_cont()16151616 if type(self.son1) == type(tuple()):1617 son1 = self.son1[0].traducir()1618 else: 1619 son1 = self.son1.traducir()16201621 if type(self.son2) == type(tuple()):1622 son2 = self.son2[0].traducir()1623 else: 1624 son2 = self.son2.traducir()16251626 txt += id + "[label= "+self.name+"]"+"\n\t"1627 txt += id + " -> " + son1 + "\n\t"1628 txt += id + " -> " + son2 + "\n\t"16291630 return id163116321633class condicion6(Nodo):1634 def __init__(self,son1,son2,name):1635 self.name = name1636 self.son1 = son11637 self.son2 = son216381639 def imprimir(self,ident):16401641 if type(self.son1) == type(tuple()):1642 self.son1[0].imprimir(" "+ident)1643 else:1644 self.son1.imprimir(" "+ident)1645 1646 if type(self.son2) == type(tuple()):1647 self.son2[0].imprimir(" "+ident)1648 else: 1649 self.son2.imprimir(" "+ident)16501651 print (ident + "Nodo: "+self.name)165216531654 def traducir(self):1655 global txt1656 id = incrementar_cont()16571658 if type(self.son1) == type(tuple()):1659 son1 = self.son1[0].traducir()1660 else: 1661 son1 = self.son1.traducir()16621663 if type(self.son2) == type(tuple()):1664 son2 = self.son2[0].traducir()1665 else: 1666 son2 = self.son2.traducir()16671668 txt += id + "[label= "+self.name+"]"+"\n\t"1669 txt += id + " -> " + son1 + "\n\t"1670 txt += id + " -> " + son2 + "\n\t"16711672 return id1673167416751676#------------------------------Igual-----------------------------------1677class Igual1(Nodo):1678 def __init__(self,son1,son2,son3,name):1679 self.name = name1680 self.son1 = son11681 self.son2 = son21682 self.son3 = son316831684 1685 def imprimir(self,ident):1686 self.son1.imprimir(" "+ident)1687 self.son2.imprimir(" "+ident)1688 self.son3.imprimir(" "+ident)16891690 print(ident+"Nodo: "+self.name)169116921693 def traducir(self):1694 global txt1695 id = incrementar_cont()16961697 son1 = self.son1.traducir()1698 son2 = self.son2.traducir()1699 son3 = self.son3.traducir()17001701 txt += id + "[label= "+self.name+"]"+"\n\t"1702 txt += id + " -> " + son1 + "\n\t"1703 txt += id + " -> " + son2 + "\n\t"1704 txt += id + " -> " + son3 + "\n\t"17051706 return id170717081709class Igual2(Nodo):1710 def __init__(self,son1,son2,son3,name):1711 self.name = name1712 self.son1 = son11713 self.son2 = son21714 self.son3 = son317151716 1717 def imprimir(self,ident):1718 self.son1.imprimir(" "+ident)1719 self.son2.imprimir(" "+ident)1720 self.son3.imprimir(" "+ident)17211722 print(ident+"Nodo: "+self.name)172317241725 def traducir(self):1726 global txt1727 id = incrementar_cont()17281729 son1 = self.son1.traducir()1730 son2 = self.son2.traducir()1731 son3 = self.son3.traducir()17321733 txt += id + "[label= "+self.name+"]"+"\n\t"1734 txt += id + " -> " + son1 + "\n\t"1735 txt += id + " -> " + son2 + "\n\t"1736 txt += id + " -> " + son3 + "\n\t"17371738 return id1739174017411742class Igual3(Nodo):1743 def __init__(self,son1,son2,son3,name):1744 self.name = name1745 self.son1 = son11746 self.son2 = son21747 self.son3 = son317481749 1750 def imprimir(self,ident):1751 self.son1.imprimir(" "+ident)1752 self.son2.imprimir(" "+ident)1753 self.son3.imprimir(" "+ident)17541755 print(ident+"Nodo: "+self.name)175617571758 def traducir(self):1759 global txt1760 id = incrementar_cont()17611762 son1 = self.son1.traducir()1763 son2 = self.son2.traducir()1764 son3 = self.son3.traducir()17651766 txt += id + "[label= "+self.name+"]"+"\n\t"1767 txt += id + " -> " + son1 + "\n\t"1768 txt += id + " -> " + son2 + "\n\t"1769 txt += id + " -> " + son3 + "\n\t"17701771 return id177217731774class Igual4(Nodo):1775 def __init__(self,son1,son2,son3,name):1776 self.name = name1777 self.son1 = son11778 self.son2 = son21779 self.son3 = son317801781 1782 def imprimir(self,ident):1783 self.son1.imprimir(" "+ident)1784 self.son2.imprimir(" "+ident)1785 self.son3.imprimir(" "+ident)17861787 print(ident+"Nodo: "+self.name)178817891790 def traducir(self):1791 global txt1792 id = incrementar_cont()17931794 son1 = self.son1.traducir()1795 son2 = self.son2.traducir()1796 son3 = self.son3.traducir()17971798 txt += id + "[label= "+self.name+"]"+"\n\t"1799 txt += id + " -> " + son1 + "\n\t"1800 txt += id + " -> " + son2 + "\n\t"1801 txt += id + " -> " + son3 + "\n\t"18021803 return id18041805#--------------------------------Diferente--------------------------------------------1806180718081809class Diferente1(Nodo):1810 def __init__(self,son1,son2,son3,name):1811 self.name = name1812 self.son1 = son11813 self.son2 = son21814 self.son3 = son318151816 1817 def imprimir(self,ident):1818 self.son1.imprimir(" "+ident)1819 self.son2.imprimir(" "+ident)1820 self.son3.imprimir(" "+ident)18211822 print(ident+"Nodo: "+self.name)182318241825 def traducir(self):1826 global txt1827 id = incrementar_cont()18281829 son1 = self.son1.traducir()1830 son2 = self.son2.traducir()1831 son3 = self.son3.traducir()18321833 txt += id + "[label= "+self.name+"]"+"\n\t"1834 txt += id + " -> " + son1 + "\n\t"1835 txt += id + " -> " + son2 + "\n\t"1836 txt += id + " -> " + son3 + "\n\t"18371838 return id1839184018411842class Diferente2(Nodo):1843 def __init__(self,son1,son2,son3,name):1844 self.name = name1845 self.son1 = son11846 self.son2 = son21847 self.son3 = son318481849 1850 def imprimir(self,ident):1851 self.son1.imprimir(" "+ident)1852 self.son2.imprimir(" "+ident)1853 self.son3.imprimir(" "+ident)18541855 print(ident+"Nodo: "+self.name)185618571858 def traducir(self):1859 global txt1860 id = incrementar_cont()18611862 son1 = self.son1.traducir()1863 son2 = self.son2.traducir()1864 son3 = self.son3.traducir()18651866 txt += id + "[label= "+self.name+"]"+"\n\t"1867 txt += id + " -> " + son1 + "\n\t"1868 txt += id + " -> " + son2 + "\n\t"1869 txt += id + " -> " + son3 + "\n\t"18701871 return id187218731874class Diferente3(Nodo):1875 def __init__(self,son1,son2,son3,name):1876 self.name = name1877 self.son1 = son11878 self.son2 = son21879 self.son3 = son318801881 1882 def imprimir(self,ident):1883 self.son1.imprimir(" "+ident)1884 self.son2.imprimir(" "+ident)1885 self.son3.imprimir(" "+ident)18861887 print(ident+"Nodo: "+self.name)188818891890 def traducir(self):1891 global txt1892 id = incrementar_cont()18931894 son1 = self.son1.traducir()1895 son2 = self.son2.traducir()1896 son3 = self.son3.traducir()18971898 txt += id + "[label= "+self.name+"]"+"\n\t"1899 txt += id + " -> " + son1 + "\n\t"1900 txt += id + " -> " + son2 + "\n\t"1901 txt += id + " -> " + son3 + "\n\t"19021903 return id190419051906class Diferente4(Nodo):1907 def __init__(self,son1,son2,son3,name):1908 self.name = name1909 self.son1 = son11910 self.son2 = son21911 self.son3 = son319121913 1914 def imprimir(self,ident):1915 self.son1.imprimir(" "+ident)1916 self.son2.imprimir(" "+ident)1917 self.son3.imprimir(" "+ident)19181919 print(ident+"Nodo: "+self.name)192019211922 def traducir(self):1923 global txt1924 id = incrementar_cont()19251926 son1 = self.son1.traducir()1927 son2 = self.son2.traducir()1928 son3 = self.son3.traducir()19291930 txt += id + "[label= "+self.name+"]"+"\n\t"1931 txt += id + " -> " + son1 + "\n\t"1932 txt += id + " -> " + son2 + "\n\t"1933 txt += id + " -> " + son3 + "\n\t"19341935 return id1936#--------------------------------Mayor--------------------------------------------1937class Mayor1(Nodo):1938 def __init__(self,son1,son2,son3,name):1939 self.name = name1940 self.son1 = son11941 self.son2 = son21942 self.son3 = son319431944 1945 def imprimir(self,ident):1946 self.son1.imprimir(" "+ident)1947 self.son2.imprimir(" "+ident)1948 self.son3.imprimir(" "+ident)19491950 print(ident+"Nodo: "+self.name)195119521953 def traducir(self):1954 global txt1955 id = incrementar_cont()19561957 son1 = self.son1.traducir()1958 son2 = self.son2.traducir()1959 son3 = self.son3.traducir()19601961 txt += id + "[label= "+self.name+"]"+"\n\t"1962 txt += id + " -> " + son1 + "\n\t"1963 txt += id + " -> " + son2 + "\n\t"1964 txt += id + " -> " + son3 + "\n\t"19651966 return id 196719681969class Mayor2(Nodo):1970 def __init__(self,son1,son2,son3,name):1971 self.name = name1972 self.son1 = son11973 self.son2 = son21974 self.son3 = son319751976 1977 def imprimir(self,ident):1978 self.son1.imprimir(" "+ident)1979 self.son2.imprimir(" "+ident)1980 self.son3.imprimir(" "+ident)19811982 print(ident+"Nodo: "+self.name)198319841985 def traducir(self):1986 global txt1987 id = incrementar_cont()19881989 son1 = self.son1.traducir()1990 son2 = self.son2.traducir()1991 son3 = self.son3.traducir()19921993 txt += id + "[label= "+self.name+"]"+"\n\t"1994 txt += id + " -> " + son1 + "\n\t"1995 txt += id + " -> " + son2 + "\n\t"1996 txt += id + " -> " + son3 + "\n\t"19971998 return id 199920002001class Mayor3(Nodo):2002 def __init__(self,son1,son2,son3,name):2003 self.name = name2004 self.son1 = son12005 self.son2 = son22006 self.son3 = son320072008 2009 def imprimir(self,ident):2010 self.son1.imprimir(" "+ident)2011 self.son2.imprimir(" "+ident)2012 self.son3.imprimir(" "+ident)20132014 print(ident+"Nodo: "+self.name)201520162017 def traducir(self):2018 global txt2019 id = incrementar_cont()20202021 son1 = self.son1.traducir()2022 son2 = self.son2.traducir()2023 son3 = self.son3.traducir()20242025 txt += id + "[label= "+self.name+"]"+"\n\t"2026 txt += id + " -> " + son1 + "\n\t"2027 txt += id + " -> " + son2 + "\n\t"2028 txt += id + " -> " + son3 + "\n\t"20292030 return id 20312032class Mayor4(Nodo):2033 def __init__(self,son1,son2,son3,name):2034 self.name = name2035 self.son1 = son12036 self.son2 = son22037 self.son3 = son320382039 2040 def imprimir(self,ident):2041 self.son1.imprimir(" "+ident)2042 self.son2.imprimir(" "+ident)2043 self.son3.imprimir(" "+ident)20442045 print(ident+"Nodo: "+self.name)204620472048 def traducir(self):2049 global txt2050 id = incrementar_cont()20512052 son1 = self.son1.traducir()2053 son2 = self.son2.traducir()2054 son3 = self.son3.traducir()20552056 txt += id + "[label= "+self.name+"]"+"\n\t"2057 txt += id + " -> " + son1 + "\n\t"2058 txt += id + " -> " + son2 + "\n\t"2059 txt += id + " -> " + son3 + "\n\t"20602061 return id 20622063#--------------------------------Menor-------------------------------------------- 20642065class Menor1(Nodo):2066 def __init__(self,son1,son2,son3,name):2067 self.name = name2068 self.son1 = son12069 self.son2 = son22070 self.son3 = son320712072 2073 def imprimir(self,ident):2074 self.son1.imprimir(" "+ident)2075 self.son2.imprimir(" "+ident)2076 self.son3.imprimir(" "+ident)20772078 print(ident+"Nodo: "+self.name)207920802081 def traducir(self):2082 global txt2083 id = incrementar_cont()20842085 son1 = self.son1.traducir()2086 son2 = self.son2.traducir()2087 son3 = self.son3.traducir()20882089 txt += id + "[label= "+self.name+"]"+"\n\t"2090 txt += id + " -> " + son1 + "\n\t"2091 txt += id + " -> " + son2 + "\n\t"2092 txt += id + " -> " + son3 + "\n\t"20932094 return id209520962097class Menor2(Nodo):2098 def __init__(self,son1,son2,son3,name):2099 self.name = name2100 self.son1 = son12101 self.son2 = son22102 self.son3 = son321032104 2105 def imprimir(self,ident):2106 self.son1.imprimir(" "+ident)2107 self.son2.imprimir(" "+ident)2108 self.son3.imprimir(" "+ident)21092110 print(ident+"Nodo: "+self.name)211121122113 def traducir(self):2114 global txt2115 id = incrementar_cont()21162117 son1 = self.son1.traducir()2118 son2 = self.son2.traducir()2119 son3 = self.son3.traducir()21202121 txt += id + "[label= "+self.name+"]"+"\n\t"2122 txt += id + " -> " + son1 + "\n\t"2123 txt += id + " -> " + son2 + "\n\t"2124 txt += id + " -> " + son3 + "\n\t"21252126 return id21272128class Menor3(Nodo):2129 def __init__(self,son1,son2,son3,name):2130 self.name = name2131 self.son1 = son12132 self.son2 = son22133 self.son3 = son321342135 2136 def imprimir(self,ident):2137 self.son1.imprimir(" "+ident)2138 self.son2.imprimir(" "+ident)2139 self.son3.imprimir(" "+ident)21402141 print(ident+"Nodo: "+self.name)214221432144 def traducir(self):2145 global txt2146 id = incrementar_cont()21472148 son1 = self.son1.traducir()2149 son2 = self.son2.traducir()2150 son3 = self.son3.traducir()21512152 txt += id + "[label= "+self.name+"]"+"\n\t"2153 txt += id + " -> " + son1 + "\n\t"2154 txt += id + " -> " + son2 + "\n\t"2155 txt += id + " -> " + son3 + "\n\t"21562157 return id215821592160class Menor4(Nodo):2161 def __init__(self,son1,son2,son3,name):2162 self.name = name2163 self.son1 = son12164 self.son2 = son22165 self.son3 = son321662167 2168 def imprimir(self,ident):2169 self.son1.imprimir(" "+ident)2170 self.son2.imprimir(" "+ident)2171 self.son3.imprimir(" "+ident)21722173 print(ident+"Nodo: "+self.name)217421752176 def traducir(self):2177 global txt2178 id = incrementar_cont()21792180 son1 = self.son1.traducir()2181 son2 = self.son2.traducir()2182 son3 = self.son3.traducir()21832184 txt += id + "[label= "+self.name+"]"+"\n\t"2185 txt += id + " -> " + son1 + "\n\t"2186 txt += id + " -> " + son2 + "\n\t"2187 txt += id + " -> " + son3 + "\n\t"21882189 return id219021912192#--------------------------------Mayorigual--------------------------------------------219321942195class Mayorigual1(Nodo):2196 def __init__(self,son1,son2,son3,name):2197 self.name = name2198 self.son1 = son12199 self.son2 = son22200 self.son3 = son322012202 2203 def imprimir(self,ident):2204 self.son1.imprimir(" "+ident)2205 self.son2.imprimir(" "+ident)2206 self.son3.imprimir(" "+ident)22072208 print(ident+"Nodo: "+self.name)220922102211 def traducir(self):2212 global txt2213 id = incrementar_cont()22142215 son1 = self.son1.traducir()2216 son2 = self.son2.traducir()2217 son3 = self.son3.traducir()22182219 txt += id + "[label= "+self.name+"]"+"\n\t"2220 txt += id + " -> " + son1 + "\n\t"2221 txt += id + " -> " + son2 + "\n\t"2222 txt += id + " -> " + son3 + "\n\t"22232224 return id222522262227class Mayorigual2(Nodo):2228 def __init__(self,son1,son2,son3,name):2229 self.name = name2230 self.son1 = son12231 self.son2 = son22232 self.son3 = son322332234 2235 def imprimir(self,ident):2236 self.son1.imprimir(" "+ident)2237 self.son2.imprimir(" "+ident)2238 self.son3.imprimir(" "+ident)22392240 print(ident+"Nodo: "+self.name)224122422243 def traducir(self):2244 global txt2245 id = incrementar_cont()22462247 son1 = self.son1.traducir()2248 son2 = self.son2.traducir()2249 son3 = self.son3.traducir()22502251 txt += id + "[label= "+self.name+"]"+"\n\t"2252 txt += id + " -> " + son1 + "\n\t"2253 txt += id + " -> " + son2 + "\n\t"2254 txt += id + " -> " + son3 + "\n\t"22552256 return id22572258class Mayorigual3(Nodo):2259 def __init__(self,son1,son2,son3,name):2260 self.name = name2261 self.son1 = son12262 self.son2 = son22263 self.son3 = son322642265 2266 def imprimir(self,ident):2267 self.son1.imprimir(" "+ident)2268 self.son2.imprimir(" "+ident)2269 self.son3.imprimir(" "+ident)22702271 print(ident+"Nodo: "+self.name)227222732274 def traducir(self):2275 global txt2276 id = incrementar_cont()22772278 son1 = self.son1.traducir()2279 son2 = self.son2.traducir()2280 son3 = self.son3.traducir()22812282 txt += id + "[label= "+self.name+"]"+"\n\t"2283 txt += id + " -> " + son1 + "\n\t"2284 txt += id + " -> " + son2 + "\n\t"2285 txt += id + " -> " + son3 + "\n\t"22862287 return id228822892290class Mayorigual4(Nodo):2291 def __init__(self,son1,son2,son3,name):2292 self.name = name2293 self.son1 = son12294 self.son2 = son22295 self.son3 = son322962297 2298 def imprimir(self,ident):2299 self.son1.imprimir(" "+ident)2300 self.son2.imprimir(" "+ident)2301 self.son3.imprimir(" "+ident)23022303 print(ident+"Nodo: "+self.name)230423052306 def traducir(self):2307 global txt2308 id = incrementar_cont()23092310 son1 = self.son1.traducir()2311 son2 = self.son2.traducir()2312 son3 = self.son3.traducir()23132314 txt += id + "[label= "+self.name+"]"+"\n\t"2315 txt += id + " -> " + son1 + "\n\t"2316 txt += id + " -> " + son2 + "\n\t"2317 txt += id + " -> " + son3 + "\n\t"23182319 return id23202321#--------------------------------MenorIgual--------------------------------------------2322232323242325class Menorigual1(Nodo):2326 def __init__(self,son1,son2,son3,name):2327 self.name = name2328 self.son1 = son12329 self.son2 = son22330 self.son3 = son323312332 2333 def imprimir(self,ident):2334 self.son1.imprimir(" "+ident)2335 self.son2.imprimir(" "+ident)2336 self.son3.imprimir(" "+ident)23372338 print(ident+"Nodo: "+self.name)233923402341 def traducir(self):2342 global txt2343 id = incrementar_cont()23442345 son1 = self.son1.traducir()2346 son2 = self.son2.traducir()2347 son3 = self.son3.traducir()23482349 txt += id + "[label= "+self.name+"]"+"\n\t"2350 txt += id + " -> " + son1 + "\n\t"2351 txt += id + " -> " + son2 + "\n\t"2352 txt += id + " -> " + son3 + "\n\t"23532354 return id23552356class Menorigual2(Nodo):2357 def __init__(self,son1,son2,son3,name):2358 self.name = name2359 self.son1 = son12360 self.son2 = son22361 self.son3 = son323622363 2364 def imprimir(self,ident):2365 self.son1.imprimir(" "+ident)2366 self.son2.imprimir(" "+ident)2367 self.son3.imprimir(" "+ident)23682369 print(ident+"Nodo: "+self.name)237023712372 def traducir(self):2373 global txt2374 id = incrementar_cont()23752376 son1 = self.son1.traducir()2377 son2 = self.son2.traducir()2378 son3 = self.son3.traducir()23792380 txt += id + "[label= "+self.name+"]"+"\n\t"2381 txt += id + " -> " + son1 + "\n\t"2382 txt += id + " -> " + son2 + "\n\t"2383 txt += id + " -> " + son3 + "\n\t"23842385 return id23862387class Menorigual3(Nodo):2388 def __init__(self,son1,son2,son3,name):2389 self.name = name2390 self.son1 = son12391 self.son2 = son22392 self.son3 = son323932394 2395 def imprimir(self,ident):2396 self.son1.imprimir(" "+ident)2397 self.son2.imprimir(" "+ident)2398 self.son3.imprimir(" "+ident)23992400 print(ident+"Nodo: "+self.name)240124022403 def traducir(self):2404 global txt2405 id = incrementar_cont()24062407 son1 = self.son1.traducir()2408 son2 = self.son2.traducir()2409 son3 = self.son3.traducir()24102411 txt += id + "[label= "+self.name+"]"+"\n\t"2412 txt += id + " -> " + son1 + "\n\t"2413 txt += id + " -> " + son2 + "\n\t"2414 txt += id + " -> " + son3 + "\n\t"24152416 return id241724182419class Menorigual4(Nodo):2420 def __init__(self,son1,son2,son3,name):2421 self.name = name2422 self.son1 = son12423 self.son2 = son22424 self.son3 = son324252426 2427 def imprimir(self,ident):2428 self.son1.imprimir(" "+ident)2429 self.son2.imprimir(" "+ident)2430 self.son3.imprimir(" "+ident)24312432 print(ident+"Nodo: "+self.name)243324342435 def traducir(self):2436 global txt2437 id = incrementar_cont()24382439 son1 = self.son1.traducir()2440 son2 = self.son2.traducir()2441 son3 = self.son3.traducir()24422443 txt += id + "[label= "+self.name+"]"+"\n\t"2444 txt += id + " -> " + son1 + "\n\t"2445 txt += id + " -> " + son2 + "\n\t"2446 txt += id + " -> " + son3 + "\n\t"24472448 return id24492450#-----------------------------------------------------------------------24512452 2453class Opera(Nodo):2454 def __init__(self,son1,son2,son3,son4,son5,son6,son7,son8,son9,name):2455 self.name = name2456 self.son1 = son12457 self.son2 = son22458 self.son3 = son32459 self.son4 = son42460 self.son5 = son52461 self.son6 = son62462 self.son7 = son72463 self.son8 = son82464 self.son9 = son924652466 def imprimir(self,ident):24672468 self.son1.imprimir(" "+ident)2469 self.son2.imprimir(" "+ident)24702471 if type(self.son3) == type(tuple()):2472 self.son3[0].imprimir(" "+ident)2473 else: 2474 self.son3.imprimir(" "+ident)24752476 self.son4.imprimir(" "+ident)24772478 if type(self.son5) == type(tuple()):2479 self.son5[0].imprimir(" "+ident)2480 else: 2481 self.son5.imprimir(" "+ident)24822483 self.son6.imprimir(" "+ident)24842485 if type(self.son7) == type(tuple()):2486 self.son7[0].imprimir(" "+ident)2487 else: 2488 self.son7.imprimir(" "+ident)24892490 self.son8.imprimir(" "+ident)24912492 self.son9.imprimir(" "+ident)24932494249524962497 def traducir(self):2498 global txt2499 id = incrementar_cont()25002501 son1 = self.son1.traducir()2502 son2 = self.son2.traducir()2503 25042505 if type(self.son3) == type(tuple()):2506 son3 = self.son3[0].traducir()2507 else: 2508 son3 = self.son3.traducir()25092510 son4 = self.son4.traducir()25112512 if type(self.son5) == type(tuple()):2513 son5 = self.son5[0].traducir()2514 else: 2515 son5 = self.son5.traducir()25162517 son6 = self.son6.traducir()25182519 if type(self.son7) == type(tuple()):2520 son7 = self.son7[0].traducir()2521 else: 2522 son7 = self.son7.traducir()2523 2524 son8 = self.son8.traducir()2525 son9 = self.son9.traducir()252625272528 txt += id + "[label= "+self.name+"]"+"\n\t"2529 txt += id + " -> " + son1 + "\n\t"2530 txt += id + " -> " + son2 + "\n\t"2531 txt += id + " -> " + son3 + "\n\t"2532 txt += id + " -> " + son4 + "\n\t"2533 txt += id + " -> " + son5 + "\n\t"2534 txt += id + " -> " + son6 + "\n\t"2535 txt += id + " -> " + son7 + "\n\t"2536 txt += id + " -> " + son8 + "\n\t"2537 txt += id + " -> " + son9 + "\n\t"25382539 return id25402541#-----------------------------------------------------------------------25422543class Move(Nodo):2544 def __init__(self,son1,son2,son3,son4,son5,name):2545 self.name = name2546 self.son1 = son12547 self.son2 = son22548 self.son3 = son32549 self.son4 = son42550 self.son5 = son525512552 def imprimir(self,ident):25532554 self.son1.imprimir(" "+ident)2555 self.son2.imprimir(" "+ident)2556 self.son3.imprimir(" "+ident)2557 self.son4.imprimir(" "+ident)2558 self.son5.imprimir(" "+ident)2559 25602561 def traducir(self):2562 global txt2563 id = incrementar_cont()25642565 son1 = self.son1.traducir()2566 son2 = self.son2.traducir()2567 son3 = self.son3.traducir()2568 son4 = self.son4.traducir()2569 son5 = self.son5.traducir()25702571 txt += id + "[label= "+self.name+"]"+"\n\t"2572 txt += id + " -> " + son1 + "\n\t"2573 txt += id + " -> " + son2 + "\n\t"2574 txt += id + " -> " + son3 + "\n\t"2575 txt += id + " -> " + son4 + "\n\t"2576 txt += id + " -> " + son5 + "\n\t"25772578 return id25792580#----------------------------------------------------------------------- 25812582class Delay(Nodo):2583 def __init__(self,son1,son2,son3,son4,son5,son6,son7,name):2584 self.name = name2585 self.son1 = son12586 self.son2 = son22587 self.son3 = son32588 self.son4 = son42589 self.son5 = son52590 self.son6 = son62591 self.son7 = son7259225932594 def imprimir(self,ident):2595 self.son1.imprimir(" "+ident)2596 self.son2.imprimir(" "+ident)2597 self.son3.imprimir(" "+ident)2598 self.son4.imprimir(" "+ident)2599 self.son5.imprimir(" "+ident)2600 self.son6.imprimir(" "+ident)2601 self.son7.imprimir(" "+ident)26022603 def traducir(self):2604 global txt2605 id = incrementar_cont()26062607 son1 = self.son1.traducir()2608 son2 = self.son2.traducir()2609 son3 = self.son3.traducir()2610 son4 = self.son4.traducir()2611 son5 = self.son5.traducir()2612 son6 = self.son6.traducir()2613 son7 = self.son7.traducir()26142615 txt += id + "[label= "+self.name+"]"+"\n\t"2616 txt += id + " -> " + son1 + "\n\t"2617 txt += id + " -> " + son2 + "\n\t"2618 txt += id + " -> " + son3 + "\n\t"2619 txt += id + " -> " + son4 + "\n\t"2620 txt += id + " -> " + son5 + "\n\t"2621 txt += id + " -> " + son6 + "\n\t"2622 txt += id + " -> " + son7 + "\n\t"26232624 return id26252626#-----------------------------------------------------------------------26272628class If1(Nodo):2629 def __init__(self,son1,son2,son3,son4,son5,name):2630 self.name = name2631 self.son1 = son12632 self.son2 = son22633 self.son3 = son32634 self.son4 = son42635 self.son5 = son5263626372638 def imprimir(self,ident):26392640 self.son1.imprimir(" "+ident)2641 26422643 if type(self.son2) == type(tuple()):2644 self.son2[0].imprimir(" "+ident)2645 else: 2646 self.son2.imprimir(" "+ident)26472648 self.son3.imprimir(" "+ident)26492650 if type(self.son4) == type(tuple()):2651 self.son4[0].imprimir(" "+ident)2652 else: 2653 self.son4.imprimir(" "+ident)26542655 self.son5.imprimir(" "+ident)26562657265826592660 def traducir(self):2661 global txt2662 id = incrementar_cont()26632664 son1 = self.son1.traducir()26652666 if type(self.son2) == type(tuple()):2667 son2 = self.son2[0].traducir()2668 else: 2669 son2 = self.son2.traducir()26702671 son3 = self.son3.traducir()2672 2673 if type(self.son4) == type(tuple()):2674 son4 = self.son4[0].traducir()2675 else: 2676 son4 = self.son4.traducir()26772678 son5 = self.son5.traducir()267926802681 txt += id + "[label= "+self.name+"]"+"\n\t"2682 txt += id + " -> " + son1 + "\n\t"2683 txt += id + " -> " + son2 + "\n\t"2684 txt += id + " -> " + son3 + "\n\t"2685 txt += id + " -> " + son4 + "\n\t"2686 txt += id + " -> " + son5 + "\n\t"268726882689 return id269026912692class If2(Nodo):2693 def __init__(self,son1,son2,son3,son4,son5,son6,name):2694 self.name = name2695 self.son1 = son12696 self.son2 = son22697 self.son3 = son32698 self.son4 = son42699 self.son5 = son52700 self.son6 = son6270127022703 def imprimir(self,ident):27042705 self.son1.imprimir(" "+ident)2706 27072708 if type(self.son2) == type(tuple()):2709 self.son2[0].imprimir(" "+ident)2710 else: 2711 self.son2.imprimir(" "+ident)27122713 self.son3.imprimir(" "+ident)27142715 if type(self.son4) == type(tuple()):2716 self.son4[0].imprimir(" "+ident)2717 else: 2718 self.son4.imprimir(" "+ident)27192720 self.son5.imprimir(" "+ident)27212722 if type(self.son6) == type(tuple()):2723 self.son6[0].imprimir(" "+ident)2724 else: 2725 self.son6.imprimir(" "+ident)27262727272827292730 def traducir(self):2731 global txt2732 id = incrementar_cont()27332734 son1 = self.son1.traducir()27352736 if type(self.son2) == type(tuple()):2737 son2 = self.son2[0].traducir()2738 else: 2739 son2 = self.son2.traducir()27402741 son3 = self.son3.traducir()2742 2743 if type(self.son4) == type(tuple()):2744 son4 = self.son4[0].traducir()2745 else: 2746 son4 = self.son4.traducir()27472748 son5 = self.son5.traducir()27492750 if type(self.son6) == type(tuple()):2751 son6 = self.son6[0].traducir()2752 else: 2753 son6 = self.son6.traducir()275427552756 txt += id + "[label= "+self.name+"]"+"\n\t"2757 txt += id + " -> " + son1 + "\n\t"2758 txt += id + " -> " + son2 + "\n\t"2759 txt += id + " -> " + son3 + "\n\t"2760 txt += id + " -> " + son4 + "\n\t"2761 txt += id + " -> " + son5 + "\n\t"2762 txt += id + " -> " + son6 + "\n\t"276327642765 return id27662767#-----------------------------------------------------------------------27682769class Else(Nodo):2770 def __init__(self,son1,son2,son3,son4,name):2771 self.name = name2772 self.son1 = son12773 self.son2 = son22774 self.son3 = son32775 self.son4 = son42776 277727782779 def imprimir(self,ident):27802781 self.son1.imprimir(" "+ident)27822783 self.son2.imprimir(" "+ident)27842785 if type(self.son3) == type(tuple()):2786 self.son3[0].imprimir(" "+ident)2787 else: 2788 self.son3.imprimir(" "+ident)27892790 self.son4.imprimir(" "+ident)279127922793279427952796 def traducir(self):2797 global txt2798 id = incrementar_cont()27992800 son1 = self.son1.traducir()2801 son2 = self.son2.traducir()28022803 if type(self.son3) == type(tuple()):2804 son3 = self.son3[0].traducir()2805 else: 2806 son3 = self.son3.traducir()28072808 son4 = self.son4.traducir()2809281028112812 txt += id + "[label= "+self.name+"]"+"\n\t"2813 txt += id + " -> " + son1 + "\n\t"2814 txt += id + " -> " + son2 + "\n\t"2815 txt += id + " -> " + son3 + "\n\t"2816 txt += id + " -> " + son4 + "\n\t"2817 281828192820 return id28212822#-----------------------------------------------------------------------28232824class While(Nodo):28252826 def __init__(self,son1,son2,son3,son4,son5,son6,son7,name):2827 self.name = name2828 self.son1 = son12829 self.son2 = son22830 self.son3 = son32831 self.son4 = son42832 self.son5 = son52833 self.son6 = son62834 self.son7 = son7283528362837 def imprimir(self,ident):2838 self.son1.imprimir(" "+ident)2839 self.son2.imprimir(" "+ident)28402841 if type(self.son3) == type(tuple()):2842 self.son3[0].imprimir(" "+ident)2843 else: 2844 self.son3.imprimir(" "+ident)2845 2846 self.son4.imprimir(" "+ident)2847 self.son5.imprimir(" "+ident)2848 2849 if type(self.son6) == type(tuple()):2850 self.son6[0].imprimir(" "+ident)2851 else: 2852 self.son6.imprimir(" "+ident)28532854 self.son7.imprimir(" "+ident)28552856 def traducir(self):2857 global txt2858 id = incrementar_cont()28592860 son1 = self.son1.traducir()2861 son2 = self.son2.traducir()28622863 if type(self.son3) == type(tuple()):2864 son3 = self.son3[0].traducir()2865 else: 2866 son3 = self.son3.traducir()28672868 son4 = self.son4.traducir()2869 son5 = self.son5.traducir()28702871 if type(self.son6) == type(tuple()):2872 son6 = self.son6[0].traducir()2873 else: 2874 son6 = self.son6.traducir()28752876 son7 = self.son7.traducir()28772878 txt += id + "[label= "+self.name+"]"+"\n\t"2879 txt += id + " -> " + son1 + "\n\t"2880 txt += id + " -> " + son2 + "\n\t"2881 txt += id + " -> " + son3 + "\n\t"2882 txt += id + " -> " + son4 + "\n\t"2883 txt += id + " -> " + son5 + "\n\t"2884 txt += id + " -> " + son6 + "\n\t"2885 txt += id + " -> " + son7 + "\n\t"28862887 return id2888 2889#----------------------------------------------------------------------- 28902891class For(Nodo):2892 def __init__(self,son1,son2,son3,son4,son5,son6,son7,son8,son9,name):2893 self.name = name2894 self.son1 = son12895 self.son2 = son22896 self.son3 = son32897 self.son4 = son42898 self.son5 = son52899 self.son6 = son62900 self.son7 = son72901 self.son8 = son82902 self.son9 = son929032904 def imprimir(self,ident):29052906 self.son1.imprimir(" "+ident)2907 self.son2.imprimir(" "+ident)2908 self.son3.imprimir(" "+ident)2909 self.son4.imprimir(" "+ident)2910 self.son5.imprimir(" "+ident)2911 self.son6.imprimir(" "+ident)2912 self.son7.imprimir(" "+ident)29132914 if type(self.son8) == type(tuple()):2915 self.son8[0].imprimir(" "+ident)2916 else: 2917 self.son8.imprimir(" "+ident)29182919 self.son9.imprimir(" "+ident)29202921292229232924 def traducir(self):2925 global txt2926 id = incrementar_cont()29272928 son1 = self.son1.traducir()2929 son2 = self.son2.traducir()2930 son3 = self.son3.traducir()2931 son4 = self.son4.traducir()2932 son5 = self.son5.traducir()2933 son6 = self.son6.traducir()2934 son7 = self.son7.traducir()29352936 if type(self.son8) == type(tuple()):2937 son8 = self.son8[0].traducir()2938 else: 2939 son8 = self.son8.traducir()29402941 son9 = self.son9.traducir()294229432944 txt += id + "[label= "+self.name+"]"+"\n\t"2945 txt += id + " -> " + son1 + "\n\t"2946 txt += id + " -> " + son2 + "\n\t"2947 txt += id + " -> " + son3 + "\n\t"2948 txt += id + " -> " + son4 + "\n\t"2949 txt += id + " -> " + son5 + "\n\t"2950 txt += id + " -> " + son6 + "\n\t"2951 txt += id + " -> " + son7 + "\n\t"2952 txt += id + " -> " + son8 + "\n\t"2953 txt += id + " -> " + son9 + "\n\t"2954 return id295529562957#-----------------------------------------------------------------------29582959class Loop(Nodo):2960 def __init__(self,son1,son2,son3,son4,name):2961 self.name = name2962 self.son1 = son12963 self.son2 = son22964 self.son3 = son32965 self.son4 = son42966 296729682969 def imprimir(self,ident):29702971 self.son1.imprimir(" "+ident)2972 2973 self.son2.imprimir(" "+ident)2974 if type(self.son3) == type(tuple()):2975 self.son3[0].imprimir(" "+ident)2976 else: 2977 self.son3.imprimir(" "+ident)29782979 self.son4.imprimir(" "+ident)29802981 29822983298429852986 def traducir(self):2987 global txt2988 id = incrementar_cont()29892990 son1 = self.son1.traducir()2991 son2 = self.son2.traducir()29922993 if type(self.son3) == type(tuple()):2994 son3 = self.son3[0].traducir()2995 else: 2996 son3 = self.son3.traducir()29972998 son4 = self.son4.traducir()299930003001 txt += id + "[label= "+self.name+"]"+"\n\t"3002 txt += id + " -> " + son1 + "\n\t"3003 txt += id + " -> " + son2 + "\n\t"3004 txt += id + " -> " + son3 + "\n\t"3005 txt += id + " -> " + son4 + "\n\t"30063007 return id300830093010#-----------------------------------------------------------------------301130123013class Println(Nodo):30143015 def __init__(self,son1,son2,son3,son4,son5,name):3016 self.name = name3017 self.son1 = son13018 self.son2 = son23019 self.son3 = son33020 self.son4 = son43021 self.son5 = son5302230233024 def imprimir(self,ident):30253026 self.son1.imprimir(" "+ident)3027 self.son2.imprimir(" "+ident)3028 self.son3.imprimir(" "+ident)3029 self.son4.imprimir(" "+ident)3030 self.son5.imprimir(" "+ident)30313032303330343035 def traducir(self):3036 global txt3037 id = incrementar_cont()30383039 son1 = self.son1.traducir()3040 son2 = self.son2.traducir()3041 son3 = self.son3.traducir()3042 son4 = self.son4.traducir()3043 son5 = self.son5.traducir()304430453046 txt += id + "[label= "+self.name+"]"+"\n\t"3047 txt += id + " -> " + son1 + "\n\t"3048 txt += id + " -> " + son2 + "\n\t"3049 txt += id + " -> " + son3 + "\n\t"3050 txt += id + " -> " + son4 + "\n\t"3051 txt += id + " -> " + son5 + "\n\t"305230533054 return id30553056class main(Nodo):30573058 def __init__(self,son1,son2,son3,son4,name):3059 self.name = name3060 self.son1 = son13061 self.son2 = son23062 self.son3 = son33063 self.son4 = son43064306530663067 def imprimir(self,ident):30683069 self.son1.imprimir(" "+ident)3070 self.son2.imprimir(" "+ident)3071 self.son3.imprimir(" "+ident)3072 self.son4.imprimir(" "+ident)3073 30743075307630773078 def traducir(self):3079 global txt3080 id = incrementar_cont()30813082 son1 = self.son1.traducir()3083 son2 = self.son2.traducir()3084 son3 = self.son3.traducir()3085 son4 = self.son4.traducir()3086 308730883089 txt += id + "[label= "+self.name+"]"+"\n\t"3090 txt += id + " -> " + son1 + "\n\t"3091 txt += id + " -> " + son2 + "\n\t"3092 txt += id + " -> " + son3 + "\n\t"3093 txt += id + " -> " + son4 + "\n\t"309430953096 return id309730983099#----------------------------------TERMINALES DE LAS PRODUCCIONES-------------------------------3100class Inicio(Nodo):3101 def __init__(self,name):3102 self.name = name31033104 def imprimir(self,ident):3105 print (ident+"INICIO: "+self.name)3106 3107 def traducir(self):3108 global txt3109 id = incrementar_cont()3110 txt += id + "[label= \""+self.name+"\"]"+"\n\t"31113112 return id311331143115class Fin(Nodo):3116 def __init__(self,name):3117 self.name = name31183119 def imprimir(self,ident):3120 print (ident+"FIN: "+self.name)3121 3122 def traducir(self):3123 global txt3124 id = incrementar_cont()3125 txt += id + "[label= \""+self.name+"\"]"+"\n\t"31263127 return id312831293130class Let(Nodo):3131 def __init__(self,name):3132 self.name = name31333134 def imprimir(self,ident):3135 print (ident+"LET: "+self.name)3136 3137 def traducir(self):3138 global txt3139 id = incrementar_cont()3140 txt += id + "[label= \""+self.name+"\"]"+"\n\t"31413142 return id31433144314531463147class Id(Nodo):3148 def __init__(self,name):3149 self.name = name31503151 def imprimir(self,ident):3152 print (ident+"ID: "+self.name)3153 3154 def traducir(self):3155 global txt3156 id = incrementar_cont()3157 txt += id + "[label= \""+self.name+"\"]"+"\n\t"31583159 return id3160316131623163class PuntoComa(Nodo):3164 def __init__(self,name):3165 self.name = name31663167 def imprimir(self,ident):3168 print (ident+"PUNTOCOMA: "+self.name)3169 3170 def traducir(self):3171 global txt3172 id = incrementar_cont()3173 txt += id + "[label= \""+self.name+"\"]"+"\n\t"31743175 return id3176317731783179class Equal(Nodo):3180 def __init__(self,name):3181 self.name = name31823183 def imprimir(self,ident):3184 print (ident+"EQUAL: "+self.name)3185 3186 def traducir(self):3187 global txt3188 id = incrementar_cont()3189 txt += id + "[label= \""+self.name+"\"]"+"\n\t"31903191 return id31923193class IGUAL(Nodo):3194 def __init__(self,name):3195 self.name = name31963197 def imprimir(self,ident):3198 print (ident+"IGUAL: "+self.name)3199 3200 def traducir(self):3201 global txt3202 id = incrementar_cont()3203 txt += id + "[label= \""+self.name+"\"]"+"\n\t"32043205 return id3206320732083209class DIFERENTE(Nodo):3210 def __init__(self,name):3211 self.name = name32123213 def imprimir(self,ident):3214 print (ident+"DIFERENTE: "+self.name)3215 3216 def traducir(self):3217 global txt3218 id = incrementar_cont()3219 txt += id + "[label= \""+self.name+"\"]"+"\n\t"32203221 return id32223223class MAYOR(Nodo):3224 def __init__(self,name):3225 self.name = name32263227 def imprimir(self,ident):3228 print (ident+"MAYOR: "+self.name)3229 3230 def traducir(self):3231 global txt3232 id = incrementar_cont()3233 txt += id + "[label= \""+self.name+"\"]"+"\n\t"32343235 return id32363237class MENOR(Nodo):3238 def __init__(self,name):3239 self.name = name32403241 def imprimir(self,ident):3242 print (ident+"MENOR: "+self.name)3243 3244 def traducir(self):3245 global txt3246 id = incrementar_cont()3247 txt += id + "[label= \""+self.name+"\"]"+"\n\t"32483249 return id32503251class MAYORIGUAL(Nodo):3252 def __init__(self,name):3253 self.name = name32543255 def imprimir(self,ident):3256 print (ident+"MAYORIGUAL: "+self.name)3257 3258 def traducir(self):3259 global txt3260 id = incrementar_cont()3261 txt += id + "[label= \""+self.name+"\"]"+"\n\t"32623263 return id32643265class MENORIGUAL(Nodo):3266 def __init__(self,name):3267 self.name = name32683269 def imprimir(self,ident):3270 print (ident+"MENORIGUAL: "+self.name)3271 3272 def traducir(self):3273 global txt3274 id = incrementar_cont()3275 txt += id + "[label= \""+self.name+"\"]"+"\n\t"32763277 return id32783279class Suma(Nodo):3280 def __init__(self,name):3281 self.name = name32823283 def imprimir(self,ident):3284 print (ident+"SUMA: "+self.name)3285 3286 def traducir(self):3287 global txt3288 id = incrementar_cont()3289 txt += id + "[label= \""+self.name+"\"]"+"\n\t"32903291 return id32923293class Resta(Nodo):3294 def __init__(self,name):3295 self.name = name32963297 def imprimir(self,ident):3298 print (ident+"Minus: "+self.name)3299 3300 def traducir(self):3301 global txt3302 id = incrementar_cont()3303 txt += id + "[label= \""+self.name+"\"]"+"\n\t"33043305 return id33063307class Multiplica(Nodo):3308 def __init__(self,name):3309 self.name = name33103311 def imprimir(self,ident):3312 print (ident+"MULTIPLICA: "+self.name)3313 3314 def traducir(self):3315 global txt3316 id = incrementar_cont()3317 txt += id + "[label= \""+self.name+"\"]"+"\n\t"33183319 return id33203321class Divide(Nodo):3322 def __init__(self,name):3323 self.name = name33243325 def imprimir(self,ident):3326 print (ident+"Divide: "+self.name)3327 3328 def traducir(self):3329 global txt3330 id = incrementar_cont()3331 txt += id + "[label= \""+self.name+"\"]"+"\n\t"33323333 return id333433353336class Potencia(Nodo):3337 def __init__(self,name):3338 self.name = name33393340 def imprimir(self,ident):3341 print (ident+"POTENCIA: "+self.name)3342 3343 def traducir(self):3344 global txt3345 id = incrementar_cont()3346 txt += id + "[label= \""+self.name+"\"]"+"\n\t"33473348 return id334933503351#----------------------------Tipos de datos------------------------------------33523353class Integer(Nodo):3354 def __init__(self,name):3355 self.name = str(name)33563357 def imprimir(self,ident):3358 print (ident+"INTEGER: "+self.name)3359 3360 def traducir(self):3361 global txt3362 id = incrementar_cont()3363 txt += id + "[label= \""+self.name+"\"]"+"\n\t"33643365 return id33663367class Boolean(Nodo):3368 def __init__(self,name):3369 self.name = str(name)33703371 def imprimir(self,ident):3372 print (ident+"BOOLEAN: "+self.name)3373 3374 def traducir(self):3375 global txt3376 id = incrementar_cont()3377 txt += id + "[label= \""+self.name+"\"]"+"\n\t"33783379 return id33803381class String(Nodo):3382 def __init__(self,name):3383 self.name = name.strip('"')33843385 def imprimir(self,ident):3386 print (ident+"STRING: "+self.name)3387 3388 def traducir(self):3389 global txt3390 id = incrementar_cont()3391 txt += id + "[label= \""+self.name+"\"]"+"\n\t"33923393 return id33943395class OPERA(Nodo):3396 def __init__(self,name):3397 self.name = name33983399 def imprimir(self,ident):3400 print (ident+"OPERA: "+self.name)3401 3402 def traducir(self):3403 global txt3404 id = incrementar_cont()3405 txt += id + "[label= \""+self.name+"\"]"+"\n\t"34063407 return id340834093410class COMA(Nodo):3411 def __init__(self,name):3412 self.name = name34133414 def imprimir(self,ident):3415 print (ident+"COMA: "+self.name)3416 3417 def traducir(self):3418 global txt3419 id = incrementar_cont()3420 txt += id + "[label= \""+self.name+"\"]"+"\n\t"34213422 return id34233424class MOVE(Nodo):3425 def __init__(self,name):3426 self.name = name34273428 def imprimir(self,ident):3429 print (ident+"MOVE: "+self.name)3430 3431 def traducir(self):3432 global txt3433 id = incrementar_cont()3434 txt += id + "[label= \""+self.name+"\"]"+"\n\t"34353436 return id34373438class LPAREN(Nodo):3439 def __init__(self,name):3440 self.name = name34413442 def imprimir(self,ident):3443 print (ident+"LPAREN: "+self.name)3444 3445 def traducir(self):3446 global txt3447 id = incrementar_cont()3448 txt += id + "[label= \""+self.name+"\"]"+"\n\t"34493450 return id34513452class RPAREN(Nodo):3453 def __init__(self,name):3454 self.name = name34553456 def imprimir(self,ident):3457 print (ident+"RPAREN: "+self.name)3458 3459 def traducir(self):3460 global txt3461 id = incrementar_cont()3462 txt += id + "[label= \""+self.name+"\"]"+"\n\t"34633464 return id346534663467class DELAY(Nodo):3468 def __init__(self,name):3469 self.name = name34703471 def imprimir(self,ident):3472 print (ident+"DELAY: "+self.name)3473 3474 def traducir(self):3475 global txt3476 id = incrementar_cont()3477 txt += id + "[label= \""+self.name+"\"]"+"\n\t"34783479 return id348034813482class ELSE(Nodo):3483 def __init__(self,name):3484 self.name = name34853486 def imprimir(self,ident):3487 print (ident+"ELSE: "+self.name)3488 3489 def traducir(self):3490 global txt3491 id = incrementar_cont()3492 txt += id + "[label= \""+self.name+"\"]"+"\n\t"34933494 return id34953496class IF(Nodo):3497 def __init__(self,name):3498 self.name = name34993500 def imprimir(self,ident):3501 print (ident+"IF: "+self.name)3502 3503 def traducir(self):3504 global txt3505 id = incrementar_cont()3506 txt += id + "[label= \""+self.name+"\"]"+"\n\t"35073508 return id35093510class MAIN(Nodo):3511 def __init__(self,name):3512 self.name = name35133514 def imprimir(self,ident):3515 print (ident+"MAIN: "+self.name)3516 3517 def traducir(self):3518 global txt3519 id = incrementar_cont()3520 txt += id + "[label= \""+self.name+"\"]"+"\n\t"35213522 return id35233524class LLAVEL(Nodo):3525 def __init__(self,name):3526 self.name = name35273528 def imprimir(self,ident):3529 print (ident+"LLAVEL: "+self.name)3530 3531 def traducir(self):3532 global txt3533 id = incrementar_cont()3534 txt += id + "[label= \""+self.name+"\"]"+"\n\t"35353536 return id35373538class LLAVER(Nodo):3539 def __init__(self,name):3540 self.name = name35413542 def imprimir(self,ident):3543 print (ident+"LLAVER: "+self.name)3544 3545 def traducir(self):3546 global txt3547 id = incrementar_cont()3548 txt += id + "[label= \""+self.name+"\"]"+"\n\t"35493550 return id355135523553class WHILE(Nodo):3554 def __init__(self,name):3555 self.name = name35563557 def imprimir(self,ident):3558 print (ident+"WHILE: "+self.name)3559 3560 def traducir(self):3561 global txt3562 id = incrementar_cont()3563 txt += id + "[label= \""+self.name+"\"]"+"\n\t"35643565 return id35663567class FOR(Nodo):3568 def __init__(self,name):3569 self.name = name35703571 def imprimir(self,ident):3572 print (ident+"FOR: "+self.name)3573 3574 def traducir(self):3575 global txt3576 id = incrementar_cont()3577 txt += id + "[label= \""+self.name+"\"]"+"\n\t"35783579 return id 358035813582class IN(Nodo):3583 def __init__(self,name):3584 self.name = name35853586 def imprimir(self,ident):3587 print (ident+"IN: "+self.name)3588 3589 def traducir(self):3590 global txt3591 id = incrementar_cont()3592 txt += id + "[label= \""+self.name+"\"]"+"\n\t"35933594 return id 35953596class PUNTOS(Nodo):3597 def __init__(self,name):3598 self.name = name35993600 def imprimir(self,ident):3601 print (ident+"PUNTOS: "+self.name)3602 3603 def traducir(self):3604 global txt3605 id = incrementar_cont()3606 txt += id + "[label= \""+self.name+"\"]"+"\n\t"36073608 return id 36093610class LOOP(Nodo):3611 def __init__(self,name):3612 self.name = name36133614 def imprimir(self,ident):3615 print (ident+"LOOP: "+self.name)3616 3617 def traducir(self):3618 global txt3619 id = incrementar_cont()3620 txt += id + "[label= \""+self.name+"\"]"+"\n\t"36213622 return id 36233624class PRINTLN(Nodo):3625 def __init__(self,name):3626 self.name = name36273628 def imprimir(self,ident):3629 print (ident+"PRINTLN: "+self.name)3630 3631 def traducir(self):3632 global txt3633 id = incrementar_cont()3634 txt += id + "[label= \""+self.name+"\"]"+"\n\t"36353636 return id 36373638#-----------------------------------------------------------------------------3639class empty(Nodo):3640 def __init__(self,name):3641 self.name = name36423643 def imprimir(self,ident):3644 print("")36453646 def traducir(self):3647 global txt3648 id = incrementar_cont()3649 return id36503651class error(Nodo):3652 def __init__(self,name):3653 self.name = name3654 def imprimir(self,ident):3655 print("")36563657 def traducir(self):3658 global txt3659 id = incrementar_cont()3660 return id36613662 3663 ...

Full Screen

Full Screen

funções.py

Source:funções.py Github

copy

Full Screen

1from random import randint2import os3import time4dici = dict() # Dicionário vazio para organizar as maletas5lista_valores = [10, 25, 50, 75, 100, 500, 1000, 10000, 25000, 50000, 500000, 1000000] # valores das maletas6lista_vazia = [] # lista para descartar os valores já sorteados7imprimir = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]8lista1 = [10, 25, 50,75, 100, 500]9lista2 = [1000, 10000, 25000, 50000, 500000, 1000000]10lista_final = []11def capa():12 #função que cria um arquivo com a interface da capa do jogo13 # (encoding='utf-8') É o código para avisar ao python que será utilizado caracteres da tebela ASCII14 capa=open('capa.txt','w',encoding='utf-8')15 #(capa.write) #comando para escrever no arquivo16 capa.write('''\033[93m17 ╔══════════════════════════════════════════════════════════════════════════════════════════════════════╗18 ║ ║19 ║ _____ ║ 20 ║ |_ _| ___ _ __ __ _ ___ _ _ ║21 ║ | | / _ \ | '_ \ / _` | / _ \ | | | | ║22 ║ | | | (_) | | |_) | | (_| | (_) | | |_| | ║23 ║ |_| \___/ | .__/ \__,_| \___/ \__,_| ║24 ║ |_| ║25 ║ _ _ _____ __ ║26 ║ | \ | | __ _ ___ |_ _| ___ _ __ __ _ |__ \ ║27 ║ | \| | / _` | / _ \ | | / _ \ | '_ \ / _` | ) | ║28 ║ | |\ | | (_| | | (_) | | | | (_) | | |_) | | (_| | / / ║29 ║ |_| \_| \__,_| \___/ |_| \___/ | .__/ \__,_| |_| ║30 ║ |_| (_) ║31 ║ ║32 ║ ║33 ╚══════════════════════════════════════════════════════════════════════════════════════════════════════╝''')34 capa.close()35 arq=open('capa.txt','r',encoding='utf-8')36 #(arq.read()) comando para ler o arquivo37 #print(arq.read())38 for linha in arq:39 print(linha, end='')40 time.sleep(0.1)41 print()42 print(f"{'PRESSIONE ENTER PARA COMEÇAR':^113}")43 fechar = input()44 arq.close()45def creditos():46 #função que cria um arquivo com a interface da capa do jogo47 # (encoding='utf-8') É o código para avisar ao python que será utilizado caracteres da tebela ASCII48 creditos=open('creditos.txt','w',encoding='utf-8')49 creditos.write('''\033[93m50 ╔══════════════════════════════════════════════════════════════════════════════════════════════════════╗51 ║ ___ _ _ _ ║52 ║ / __| _ _ ___ __| | (_) | |_ ___ ___ ║53 ║ | (__ | '_| / -_) / _` | | | | _| / _ \ (_-< ║54 ║ \___| |_| \___| \__,_| |_| \__| \___/ /__/ ║55 ║¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯║56 ║ Alunos: ║57 ║ CAUANY NUNES RODRIGUES ║58 ║ MARIA EDUARDA VIANA CORDEIROS DOS SANTOS ║59 ║ PEDRO LÔBO NASCIMENTO ║60 ║ ║61 ║ Orientador: ║62 ║ MARCOS VINICIUS CANTIDIANO MARQUES DE ANDRADE ║63 ║ MIRNA CARELLI OLIVEIRA MAIA ║64 ║ ELAINE CRISTINA JUVINO DE ARAUJO ║65 ║ ║66 ╚══════════════════════════════════════════════════════════════════════════════════════════════════════╝''')67 creditos.close()68 arq=open('creditos.txt','r',encoding='utf-8')69 print(arq.read())70 print(f"{'PRESSIONE ENTER PARA VOLTAR AO MENU':^104}")71 fechar = input()72 arq.close()73def explicação():74 #função que cria um arquivo com a interface da capa do jogo75 # (encoding='utf-8') É o código para avisar ao python que será utilizado caracteres da tebela ASCII76 explicação=open('explicação.txt','w',encoding='utf-8')77 explicação.write(f'''\033[93m78 ╔══════════════════════════════════════════════════════════════════════════════════════════════════════╗79 ║ ___ _ _ ___ _____ ___ _ _ ___ ___ ___ _ ║80 ║ |_ _| | \| | / __| |_ _| | _ \ | | | | / __| / _ \ | __| / __| ║81 ║ | | | .` | \__ \ | | | / | |_| | | (__ | (_) | | _| \__ \ ║82 ║ |___| |_|\_| |___/ |_| |_|_\ \___/ \___| \___/ |___| |___/ ║83 ║¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯║84 ║ O Jogo funciona da seguinte forma: ║85 ║ O jogador deverá escolher uma maleta misteriosa no começo do jogo, a qual não será revelada, ║86 ║ esta maleta conterá o valor que ele receberá ao fim do jogo caso recuse as ofertas do banqueiro. ║87 ║ A partir disso, ele deverá abrir maletas, que contém os valores que o jogador está deixando de ║88 ║ ganhar, após 4 maletas, o banqueiro fará a primeira oferta baseada nos valores que ainda restarem ║89 ║ em jogo, cabe ao jogador aceitar ou ceder à tentadora oferta. Em caso de recusa, o jogo prossegue ║90 ║ com voltas periódicas do banqueiro com mais ofertas que podem aumentar ou diminuir de acordo ║91 ║ com a situação do jogo. ║92 ║ Quando restarem apenas 2 maletas em jogo, contando com a escolhida pelo jogador, o banqueiro ║93 ║ fará a última oferta, caso recuse o jogador terá direito de escolher a maleta misteriosa, ou a ║94 ║ última que sobrar sobre a mesa. Você Topa ou Não Topa? ║95 ║ ║96 ╚══════════════════════════════════════════════════════════════════════════════════════════════════════╝''')97 explicação.close()98 arq=open('explicação.txt','r',encoding='utf-8')99 print(arq.read())100 print(f"{'PRESSIONE ENTER PARA VOLTAR AO MENU':^104}")101 fechar = input()102 arq.close()103def maletas(escolha):104 os.system('cls')105 a = escolha106 if len(lista1)+len(lista2) == 12:107 for p in range(len(imprimir)):108 if imprimir[p] == a:109 imprimir[p] = '###'110 else:111 for i in range(len(imprimir)):112 if imprimir[i] == a:113 lista_final.append(imprimir[i])114 imprimir[i] = dici['maleta' + str(a)]115 print(f"""\033[93m116 {'-' * 104}117 ╔══════════════════════════════════════════════════════════════════════════════════════════════════════╗118 ║ ║119 ║ _ _ _ _ _ _ ║120 ║ _ _ _|_|_ _ _ _ _ _|_|_ _ _ _ _ _|_|_ _ _ _ _ _|_|_ _ _ _ _ _|_|_ _ _ _ _ _|_|_ _ _ ║121 ║ | | | | | | | | | | | | ║122 ║ |{imprimir[0]:^13}| |{imprimir[1]:^13}| |{imprimir[2]:^13}| |{imprimir[3]:^13}| |{imprimir[4]:^13}| |{imprimir[5]:^13}| ║123 ║ | | | | | | | | | | | | ║124 ║ |_ _ _ _ _ _ _| |_ _ _ _ _ _ _| |_ _ _ _ _ _ _| |_ _ _ _ _ _ _| |_ _ _ _ _ _ _| |_ _ _ _ _ _ _| ║125 ║ ║ 126 ║ _ _ _ _ _ _ ║127 ║ _ _ _|_|_ _ _ _ _ _|_|_ _ _ _ _ _|_|_ _ _ _ _ _|_|_ _ _ _ _ _|_|_ _ _ _ _ _|_|_ _ _ ║128 ║ | | | | | | | | | | | | ║129 ║ |{imprimir[6]:^13}| |{imprimir[7]:^13}| |{imprimir[8]:^13}| |{imprimir[9]:^13}| |{imprimir[10]:^13}| |{imprimir[11]:^13}| ║130 ║ | | | | | | | | | | | | ║131 ║ |_ _ _ _ _ _ _| |_ _ _ _ _ _ _| |_ _ _ _ _ _ _| |_ _ _ _ _ _ _| |_ _ _ _ _ _ _| |_ _ _ _ _ _ _| ║132 ║ ║133 ╚══════════════════════════════════════════════════════════════════════════════════════════════════════╝""")134 print(f"{'Valores restantes: ':>8}{lista_valores}")135def uma_maleta():136 os.system('cls')137 print(f"""\033[93m138 {'-' * 104} 139 ╔══════════════════════════════════════════════════════════════════════════════════════════════════════╗140 ║ ║141 ║ _ _ _ _ _ _ ║142 ║ _ _ _|_|_ _ _ _ _ _|_|_ _ _ _ _ _|_|_ _ _ _ _ _|_|_ _ _ _ _ _|_|_ _ _ _ _ _|_|_ _ _ ║143 ║ | | | | | | | | | | | | ║144 ║ |{imprimir[0]:^13}| |{imprimir[1]:^13}| |{imprimir[2]:^13}| |{imprimir[3]:^13}| |{imprimir[4]:^13}| |{imprimir[5]:^13}| ║145 ║ | | | | | | | | | | | | ║146 ║ |_ _ _ _ _ _ _| |_ _ _ _ _ _ _| |_ _ _ _ _ _ _| |_ _ _ _ _ _ _| |_ _ _ _ _ _ _| |_ _ _ _ _ _ _| ║147 ║ ║ 148 ║ _ _ _ _ _ _ ║149 ║ _ _ _|_|_ _ _ _ _ _|_|_ _ _ _ _ _|_|_ _ _ _ _ _|_|_ _ _ _ _ _|_|_ _ _ _ _ _|_|_ _ _ ║150 ║ | | | | | | | | | | | | ║151 ║ |{imprimir[6]:^13}| |{imprimir[7]:^13}| |{imprimir[8]:^13}| |{imprimir[9]:^13}| |{imprimir[10]:^13}| |{imprimir[11]:^13}| ║152 ║ | | | | | | | | | | | | ║153 ║ |_ _ _ _ _ _ _| |_ _ _ _ _ _ _| |_ _ _ _ _ _ _| |_ _ _ _ _ _ _| |_ _ _ _ _ _ _| |_ _ _ _ _ _ _| ║154 ║ ║155 ╚══════════════════════════════════════════════════════════════════════════════════════════════════════╝""")156 print(f"{'Valores restantes: ':>8}{lista_valores}")157def banqueiro(lista1, lista2):158 os.system('cls')159 sorteio1 = ['650', '950', '2.200', '6.400', '11.000']160 sorteio2 = ['0', '55', '100', '300', '550']161 sorteio3 = ['15.000', '25.000', '40.000', '90.000', '150.000']162 num = randint(0, 4)163 if len(lista1) == len(lista2):164 quantia = sorteio1[num]165 elif len(lista2) > len(lista1):166 quantia = sorteio2[num]167 elif len(lista1) > len(lista2):168 quantia = sorteio3[num]169 #Manipulação de string170 x=f'''171 ╔══════════════════════════════════════════════════════════════════════════════════════════════════════╗172 ║ ║173 ║ topa ou não topa? ║174 ║ ║175 ║¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯║176 ║ AcEiTa PaRaR o JoGo PoR ║177 ║ ║178 ║══════════════════════════════════════════ {quantia:^7} REAIS? ═══════════════════════════════════════════║179 ║ ║180 ║ ║181 ║ _ ___ ___ __ __ ___ _ _ _ ___ ║182 ║ / | / __| |_ _| | \/ | |_ ) | \| | /_\ / _ \ ║183 ║ | | __ \__ \ | | | |\/| | / / __ | .` | / _ \ | (_) | ║184 ║ |_| |___/ |___| |_| |_| /___| |_|\_| /_/ \_\ \___/ ║185 ║ ║186 ║ ║187 ╚══════════════════════════════════════════════════════════════════════════════════════════════════════╝'''188 print(x.upper())189 print(f"{'Valores restantes: ':>42}{lista_valores}")190 return (quantia)191def menu():192 os.system('cls')193 print(f'''\033[93m194 ╔══════════════════════════════════════════════════════════════════════════════════════════════════════╗195 ║ __ __ ___ __ _ __ _ __ ___ ___ ║196 ║ | _ \ | _ \ | __| | _ \ / \ | _ \ / \ | \ / _ \ |__ \ ║197 ║ | _/ | / | _| | _/ / _ \ | / / _ \ | |) | | (_) | /_/ ║198 ║ |_| |_|_\ |___| |_| /_/ \_\ |_|_\ /_/ \_\ |___/ \___/ (_) ║ 199 ║¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯║200 ║ ║201 ║ ────────────────── ────────────────── ║202 ║ 1 - INICIAR 2 - EXPLICAÇÃO ║203 ║ ────────────────── ────────────────── ║204 ║ ║205 ║ ────────────────── ────────────────── ║206 ║ 3 - CRÉDITOS 4 - SAIR ║207 ║ ────────────────── ────────────────── ║208 ║ ║209 ║ ║210 ╚══════════════════════════════════════════════════════════════════════════════════════════════════════╝''')211 print(f'{"Opção escolhida: ":^30}')212 opcao = (input('>>>\033[m'))213 return (opcao)214def escolha(n):215 while len(lista1) + len(lista2) > n:216 x = input('Descarte uma maleta: ')217 maletas(int(x))218 if int(x) < 1 or int(x) > 12:219 print('---maleta inexistente---')220 else:221 x = dici["maleta" + x]222 if x in lista1:223 lista1.remove(x)224 lista_valores.remove(x)225 elif x in lista2:226 lista2.remove(x)227 lista_valores.remove(x)228 else:229 print('---maleta já descartada---')230 #time.sleep(2)231 valor = banqueiro(lista1, lista2)232 return (valor)233def sorteio():234 b=0235 a = 'maleta'236 # loop para sorteio237 while len(dici) < 12: # PROPOSTA DE COLOCAR NUMA FUNÇÃO PARA PREENCHER MALETAS. JOGA NO OUTRO ARQUIVO E IMPORTA238 var = lista_valores[randint(0, 11)]239 #manipulação de string240 if var not in lista_vazia:241 b += 1242 c = str(b)243 dici[a + c] = var244 lista_vazia.append(var)245def parabens(money):246 os.system('cls')247 #manipulação de string248 var='VOCÊGANHOU'249 print(f'''\033[93m250 ╔══════════════════════════════════════════════════════════════════════════════════════════════════════╗251 ║ ║252 ║ ║253 ║ ║254 ║ ___ _ ___ _ ___ ___ _ _ ___ _ _ _ ║255 ║ | _ \ /_\ | _ \ /_\ | _ ) | __| | \| | / __| | | | | | | ║256 ║ | _/ / _ \ | / / _ \ | _ \ | _| | .` | \__ \ |_| |_| |_| ║257 ║ |_| /_/ \_\ |_|_\ /_/ \_\ |___/ |___| |_|\_| |___/ (_) (_) (_) ║258 ║ ║259 ║ ║260 ║ ║261 ║ {var[:4]} {var[4:]} {money:^7} REAIS ║262 ║ ║263 ║ ║264 ║ ║265 ║ ║266 ╚══════════════════════════════════════════════════════════════════════════════════════════════════════╝''')267def escolhaf():268 os.system('cls')269 for r in range(len(imprimir)):270 imprimir[r] = str(imprimir[r])271 for e in range(len(imprimir)):272 if len(imprimir[e])<=2 and imprimir[e] not in lista_final:273 finalmente = imprimir[e]274 for g in range(len(imprimir)):275 if imprimir[g] == '###':276 finalmente1 = imprimir[g]277 print(f'''\033[93m278 ╔══════════════════════════════════════════════════════════════════════════════════════════════════════╗279 ║ ║280 ║ DECISÃO FINAL ║281 ║ ║ 282 ║¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯║283 ║ VOCÊ ESCOLHE DESCARTAR... ║284 ║ ║285 ║ {'1 - PARA':^13} {'2 - PARA':^13} ║286 ║ ║287 ║ _ _ ║288 ║ _ _ _|_|_ _ _ _ _ _|_|_ _ _ ║289 ║ | | | | ║290 ║ |{finalmente1:^13}| |{finalmente:^13}| ║291 ║ | | | | ║292 ║ |_ _ _ _ _ _ _| |_ _ _ _ _ _ _| ║293 ║ ─────────────────── ─────────────────── ║294 ╚══════════════════════════════════════════════════════════════════════════════════════════════════════╝''')295def premio_perdido(reserva,x):296 if x == 'banqueiro':297 print(f'''\033[93m298 ╔══════════════════════════════════════════════════════════════════════════════════════════════════════╗299 ║ ║300 ║ OLHE O QUE VOCÊ PERDEU! ║301 ║ ║302 ║¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯║303 ║ ║304 ║ ║305 ║ M A L E T A ║306 ║ R E S E R V A ║307 ║ _ ║308 ║ _ _ _|_|_ _ _ ║309 ║ | | ║310 ║ |{reserva:^13}| ║311 ║ | | ║312 ║ |_ _ _ _ _ _ _| ║313 ║ ────────────────── ║314 ╚══════════════════════════════════════════════════════════════════════════════════════════════════════╝''')315 elif x == 'final':316 if len(lista1) > len(lista2):317 print(f'''\033[93m318 ╔══════════════════════════════════════════════════════════════════════════════════════════════════════╗319 ║ ║320 ║ OLHE O QUE VOCÊ PERDEU! ║321 ║ ║ 322 ║¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯║323 ║ ║324 ║ ║325 ║ M A L E T A M A L E T A ║326 ║ R E S E R V A R E S T A N T E ║327 ║ _ _ ║328 ║ _ _ _|_|_ _ _ _ _ _|_|_ _ _ ║329 ║ | | | | ║330 ║ |{reserva:^13}| |{lista1[0]:^13}| ║331 ║ | | | | ║332 ║ |_ _ _ _ _ _ _| |_ _ _ _ _ _ _| ║333 ║ ────────────────── ────────────────── ║334 ╚══════════════════════════════════════════════════════════════════════════════════════════════════════╝''')335 elif len(lista1) < len(lista2):336 print(f'''\033[93m337 ╔══════════════════════════════════════════════════════════════════════════════════════════════════════╗338 ║ ║339 ║ OLHE O QUE VOCÊ PERDEU! ║340 ║ ║ 341 ║¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯║342 ║ ║343 ║ ║344 ║ M A L E T A M A L E T A ║345 ║ R E S E R V A R E S T A N T E ║346 ║ _ _ ║347 ║ _ _ _|_|_ _ _ _ _ _|_|_ _ _ ║348 ║ | | | | ║349 ║ |{reserva:^13}| |{lista2[0]:^13}| ║350 ║ | | | | ║351 ║ |_ _ _ _ _ _ _| |_ _ _ _ _ _ _| ║352 ║ ────────────────── ────────────────── ║353 ╚══════════════════════════════════════════════════════════════════════════════════════════════════════╝''')...

Full Screen

Full Screen

functions_by_test.py

Source:functions_by_test.py Github

copy

Full Screen

1import random2from pylabeador import syllabify3def main():4 try:5 6 input_letter = input("Please type an alphabet letter: ")7 word = alphabet(input_letter)8 print(word)9 silaba = get_word(word)10 print(silaba)11 except AttributeError:12 print(f"Sorry you typed a number")13 print("try with a letter")14def alphabet(input_letter):15 16 a_list = ["abecedario","amor","araña","abeja","Ana","árbol"17 ,"admiración","ancla","archivo","agua","Andrés", "arcoiris",18 "aguacate", "angustia","Argentina","águila", "anillo", "arquitectura",19 "ala", "ansiedad", "arroyo","alma", "antena" ,"arte",20 "altura", "anteojo", "automóvil","ambulancia", "antorcha", "avión",21 "abandonar" ,"adornar" ,"aprovechar","ablandar", "afeitar", "arder",22 "abrir" ,"afilar", "arrojar","absorber" ,"alimentar", "asentir","acceder","amar","asistir","accionar","andar","atacar","acelerar","añadir","aterrar","aceptar","aplicar","atrapar","admirar" ,"apoyar", "avisar","admitir","aprender","ayudar","abatido","ágil","amigable","abierto","agudo","análogo","abismal","ajado","anaranjado","abominable","ajustado","ancho","abrupto","alegre","angosto","aburrido","alejado","anticuada","ácido","alpino","antiguo"23 ,"activo", "altaneros","artesanal","adicto","amargo","astuta","adorable","amarillento", "azul"]24 25 b_list = ["baba","baúl","boda","bajo","bonito","bebé", "babero", "bajada", "begoña"]26 27 c_list = ["cena","ceniza","boca","caramelo","casa","caza"]28 d_list = ["daño", "dama","daga","dato",29 "dádiva","debajo","debate","dedo","décimo","doce","duda","dureza"]30 e_list = ["enfático","escopeta","engaño","esfera","espejo",31 "estable","estaca","entero","embarazo","embudo","empanada","envase","excusa","escoba"]32 f_list = ["fábrica","fábula","fosa","famélico","fino","famoso","físico","fatigado","fe","foca","futuro"]33 g_list = ["galope","giro","gamuza","ganado","garaje","goloso","goma","gélido","gemelo","gótico"]34 h_list = ["Habano","Hexágono","Haya","Hazaña","Halo","Hamaca","haba"35 ,"haber","hablar","hacendado","hacer","hacha","hache","hacía","hacienda","hacinar","hada","haga"36 ,"halar","halcón","hallado","hallar","hará","haremos","harina","hartar","hartazgo"37 ,"harto","hasta","hastío","haya","haz","he","hebilla","hebra","hebreo","hectárea","hectómetro","hedor","heladera"]38 i_list = ["ícono","incidir","insignificante","idea","incipiente","insistente"39 ,"identificar","inclinación","institucional","ideología","incoherente","instruir"40 ,"idolatrar","incómoda","inteligencia","iglesia","incorrecto","intención"41 ,"iglú" ,"increíble","intensidad","ignorante","indagación","interferir","igualdad","indecisión","internacional"42 ,"ilegal","indicio","internet","ilógico","indignado","interrumpir","iluminar","indispensable","intervenir"43 ,"ilusión","individua","intimidad","imaginar","indulgencia","intolerante","imán","industria","introducir"44 ,"imitar","infantil","intuitivo"]45 j_list = ["jabalí","jabón","jacarandá"46 ,"jactar","jacuzzi","jade","jadear","jaguar","jalar","jalea","jaleo","jalón"47 ,"jalonar","jamás","jamón","japonés","jaque","jaquear","jaqueca","jarabe"]48 49 k_list = ["Karate","Karaoke","Kamikaze","Karma","Kayac",50 "Kebab","Kendo","Keratina","Kernel","Kevlar","Kevin","Kétchup","Kia"51 ,"Kiwi","Kilo","Kilogramo","Kilómetros","Kilobyte","Kimono","Kiosko"]52 53 l_list = ["laberinto","lentitud","listar"54 ,"labio","leña","literario","laboratorio","lesión","litigar","lacio","letal","liviana"55 ,"ladear","letra","llama","ladrido","levantar","llamar","ladrillo","levar"]56 57 m_list = ["maceta", "marinar", "mito","machista","marítimo","mixto"58 ,"macizo","marrón","moderna","madera","martillar","mojado"59 ,"madre","masajear","moldear","madrugar","máscara","molesto","madurar", "masivo"]60 n_list = ["nabo","navideño","ningunear","nácar","nazismo","niño","nacer","neblina","nirvana"61 ,"nación","nebulizar","nítido","nada","nebuloso","nivelar","nadar","neceser","noble","nafta","necesidad"]62 63 o_list = ["obediente","ofrecer","optimista","obesidad","ofuscado","óptimo","objetar","oír","opuesto"64 ,"objetivo","ojo","oral","oblicuo","oleaje","orar","obligación","olfatear","órbita","obnubilar","oligárquica"]65 p_list = ["pacífico","perfumar","preferir","paisaje","periodístico","pregunta"66 ,"palabra","perjudicar","preocupado","palanca","permitir","preservar"67 ,"pantanoso","persona","prestar","paralelo","persuadir","prestigio","paralizar","peyorativo"]68 q_list = ["que","querella","quincena","quebracho","querellante","quiniela","quebrada","querido","quinoa"69 ,"quebradizo","quesadilla","quinto","quebranto","queso","quíntuple","quechua","quienquiera","quirúrgico","quedado","quieto"]70 r_list = ["rapido","reir","risueño","rodrigo","rosa","rodolfo","reunir","ricardo","reparar","roblox"71 ,"rana","rata","ratón","raya","reno","rinoceronte","ruiseñor","riachuelo","rivera","rio"]72 s_list = ["Sabático","Sabado","Sabiduría","Sabor","Sabor","Safari"73 ,"Sal","Sala","Salario","Saliva","Salvaje","Salud","Salón"74 ,"Samba","Sangre","Santo","Sapo","Sarro","Secreto","Secta","Seguridad","Sello","Selva"]75 76 t_list = ["Tabaco","Tabla","Tabú","Táctica","Tala","Talento",77 "Tallo","Tambor","Tarjeta","Tatuaje","Teatro""Techo","Teclado","Tecnología"78 ,"Teja","Tejido","Tela","Telar","Telescopio","Temperamento"]79 u_list = ["Ubre","Ungüento","Uno","Unico","Ulcera","Ultrasonido","Unidad","Unilateral"80 ,"Unión","Uniciclo","Unicelular","Unipersonal","Unisono","Universal","Universidad","Unisex","Uña","Uranio","Urbano","Urgente"]81 82 v_list = ["Vacuna","Valle","Válvula","Vanguardia","Variable","Vector","Vegetación"83 ,"Vegetales","Vegetariano","Vehículo","Vela","Velocidad"84 ,"Vendaje","Vendedor","Veneno","Venta","Ventanas","Ventilador","Verbo","Verdad"]85 86 w_list = ["Waffle","Waterpolo","Walkman","Web","Wikipedia","Wasabi","Wisky","Wincha","WiFi"]87 x_list = ["Xanadu","Xavier","Xenofobia","Xiaomi","Xilote","Xinca","Xilofono"88 ,"Xilofonista","Ximena","Xiomara","Xerocopie","Xochimilco","Xochicalco"]89 y_list = ["Ya"90 ,"Yacer","Yacente","Yacimiento","Yaguasa","Yapa","Yate"91 ,"Yunto","Yoga","Yogar","Yerno","Yeso","Yerba","Yerno","Yo","Yodo"]92 z_list = ["Zancudo","Zanja","Zapata","Zapatilla"93 ,"Zapato","Zara","Zarpa","Zarpado"94 ,"Zarpazo","Zika","Zócalo","Zombis","Zona","Zorros"]95 96 if input_letter.lower() == "a":97 imprimir = random.choice(a_list)98 return imprimir99 elif input_letter.lower() == "b":100 imprimir = random.choice(b_list)101 return imprimir102 elif input_letter.lower() == "c":103 imprimir = random.choice(c_list)104 return imprimir105 elif input_letter.lower() == "d":106 imprimir = random.choice(d_list)107 return imprimir108 elif input_letter.lower() == "e":109 imprimir = random.choice(e_list)110 return imprimir111 elif input_letter.lower() == "f":112 imprimir = random.choice(f_list)113 return imprimir114 elif input_letter.lower() == "g":115 imprimir = random.choice(g_list)116 return imprimir117 elif input_letter.lower() == "h":118 imprimir = random.choice(h_list)119 return imprimir 120 elif input_letter.lower() == "i":121 imprimir = random.choice(i_list)122 return imprimir123 elif input_letter.lower() == "j":124 imprimir = random.choice(j_list)125 return imprimir 126 elif input_letter.lower() == "k":127 imprimir = random.choice(k_list)128 return imprimir129 elif input_letter.lower() == "l":130 imprimir = random.choice(l_list)131 return imprimir 132 elif input_letter.lower() == "m":133 imprimir = random.choice(m_list)134 return imprimir135 elif input_letter.lower() == "n":136 imprimir = random.choice(n_list)137 return imprimir138 elif input_letter.lower() == "o":139 imprimir = random.choice(o_list)140 return imprimir141 elif input_letter.lower() == "p":142 imprimir = random.choice(p_list)143 return imprimir 144 elif input_letter.lower() == "q":145 imprimir = random.choice(q_list)146 return imprimir147 elif input_letter.lower() == "r":148 imprimir = random.choice(r_list)149 return imprimir150 elif input_letter.lower() == "s":151 imprimir = random.choice(s_list)152 return imprimir 153 elif input_letter.lower() == "t":154 imprimir = random.choice(t_list)155 return imprimir156 elif input_letter.lower() == "u":157 imprimir = random.choice(u_list)158 return imprimir 159 elif input_letter.lower() == "v":160 imprimir = random.choice(v_list)161 return imprimir162 elif input_letter.lower() == "w":163 imprimir = random.choice(w_list)164 return imprimir 165 elif input_letter.lower() == "x":166 imprimir = random.choice(x_list)167 return imprimir 168 elif input_letter.lower() == "y":169 imprimir = random.choice(y_list)170 return imprimir171 elif input_letter.lower() == "z":172 imprimir = random.choice(z_list)173 return imprimir174def get_word(word):175 176 silabas = syllabify(word)177 return silabas178 179 180 181if __name__ in "__main__":...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run SeleniumBase automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful