From b5ac6aa74d07a6f6d38657ab7cf36ff15f2edfb1 Mon Sep 17 00:00:00 2001 From: TiagoRG <35657250+TiagoRG@users.noreply.github.com> Date: Wed, 18 Jan 2023 19:02:26 +0000 Subject: [PATCH] FP: Extra3 - Ex11 simplification ISD: Quick fix --- 1ano/README.md | 6 ++++++ 1ano/fp/extra3/ex11.py | 9 +-------- .../quartus-projects/AdderDemo/AdderDemo.qws | Bin 1274 -> 1848 bytes .../AdderDemo/db/AdderDemo.db_info | 2 +- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/1ano/README.md b/1ano/README.md index b279da9..925f87c 100755 --- a/1ano/README.md +++ b/1ano/README.md @@ -6,5 +6,11 @@ - [Introdução à Engenharia Informática](https://github.com/TiagoRG/uaveiro-leci/tree/master/1ano/iei) | Ano de conclusão: 2022/2023 - [Introdução aos Sistemas Digitais](https://github.com/TiagoRG/uaveiro-leci/tree/master/1ano/isd) | Ano de conclusão: 2022/2023 +### 2º Semestre + +- [Programação Orientada a Objetos](https://github.com/TiagoRG/uaveiro-leci/tree/master/1ano/poo) +- [Laboratórios de Informática](https://github.com/TiagoRG/uaveiro-leci/tree/master/1ano/labi) +- [Laboratório de Sistemas Digitais](https://github.com/TiagoRG/uaveiro-leci/tree/master/1ano/lsd) + --- *Pode conter erros, caso encontre algum, crie um* [*ticket*](https://github.com/TiagoRG/uaveiro-leci/issues/new) diff --git a/1ano/fp/extra3/ex11.py b/1ano/fp/extra3/ex11.py index eea9be7..6292b2c 100644 --- a/1ano/fp/extra3/ex11.py +++ b/1ano/fp/extra3/ex11.py @@ -1,11 +1,4 @@ def onlyCaps(s): # NOTE: ch.isupper() -> True if ch is uppercase. - if len(s) == 0: - return "" - if len(s) == 1: - return s if s.isupper() else "" - return s[0] + onlyCaps(s[1:]) if s[0].isupper() else onlyCaps(s[1:]) + return (s if len(s) == 0 or (len(s) == 1 and s.isupper()) else "") if len(s) <= 1 else (s[0] + onlyCaps(s[1:]) if s[0].isupper() else onlyCaps(s[1:])) - -print(onlyCaps("John Fitzgerald Kennedy")) -print(onlyCaps("")) diff --git a/1ano/isd/quartus-projects/AdderDemo/AdderDemo.qws b/1ano/isd/quartus-projects/AdderDemo/AdderDemo.qws index 2864c4fbb6e7853e05ab0a3d88b3fc1c8df31db4..8a9126ba8eb9e1237a5e7617a896869e436441b4 100644 GIT binary patch delta 298 zcmZXOyG}wu7=*vwgC;Z-6h44Zm~aUfiDICjvj#$sESG}H5MyI(jg=?oDJba(HSa=i zY2rD~o}szy&7$$D%v#~!dM-%G~3i}@TSH*|6Vt;&8J2p@aqR$Jb--^ z$q;_;jg8`