Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

. #15

Merged
merged 1 commit into from
Apr 4, 2024
Merged

. #15

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions Operasaun no manipulasaun string/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# operasaun logika no boolean

Operasaun no manipulasaun string hanesan asaun sira ne'ebé ita bele halo ho string sira iha Python. Ne'e inklui konkatenasaun, kaptura medida (length), fatia (slice), peskiza, no transformasaun ba maiúsula ka minúscula, entre operasaun sira seluk.

Lista operasaun no manipulasaun string sira:

1. **Konkatenasaun**: Kombina duas ka buka string sira.

```python
string1 = "Ola,"
string2 = " mundu!"
mensagem = string1 + string2
print(mensagem) # Sai "Ola, mundu!"
```

2. **Kaptura Medida (Length)**: Determina medida husi string.

```python
mensagem = "Ola, mundu!"
comprimentu = len(mensagem)
print(comprimentu) # Sai 12
```

3. **Fatia (Slice)**: Buka parte spesífiku husi string.

```python
mensagem = "Ola, mundu!"
fatia = mensagem[4:9]
print(fatia) # Sai "mundu"
```

4. **Peskiza**: Prokura string ida iha string seluk.

```python
mensagem = "Ola, mundu!"
resultado = mensagem.find("mundu")
print(resultado) # Sai 5
```

5. **Maiúsula ka Minúscula**: Transforma string ba maiúsula ka minúscula.

```python
mensagem = "Ola, mundu!"
maiusula = mensagem.upper()
minuscula = mensagem.lower()
print(maiusula) # Sai "OLA, MUNDU!"
print(minuscula) # Sai "ola, mundu!"
```

6. **Substituisaun**: Substitui parte spesífiku husi string.

```python
mensagem = "Ola, mundu!"
nova_mensagem = mensagem.replace("mundu", "amigu")
print(nova_mensagem) # Sai "Ola, amigu!"
```
41 changes: 41 additions & 0 deletions Operasaun no manipulasaun string/exerciciu/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
### Exerciciu I

Pratika operasaun no manipulasaun string iha Python, inklui aumenta tan iha string.

1. **Exercísiu 1**: Aumenta "bomba" iha string "Bomba! Bomba! Bomba!".

```python
string = "Bomba! "
aumenta_tan = "Bomba! " * 2
mensagem = string + aumenta_tan
print(mensagem)
```

2. **Exercísiu 2**: Substitui parte husi string.

```python
mensagem = "Karik sei iha tan aumenta tan."
nova_mensagem = mensagem.replace("aumenta tan", "ho susar")
print(nova_mensagem)
```

3. **Exercísiu 3**: Kria string ho konkatenasaun husi variável sira.

```python
nome = "Maria"
idade = 25
profisaun = "doktor"

perfil = "Nia naran mak " + nome + ", idade " + str(idade) + ", profisaun " + profisaun + "."
print(perfil)
```

4. **Exercísiu 4**: Determina medida husi string no hatudu primeiru lima letra.

```python
texto = "Oloron ipsum dolor sit amet."
medida = len(texto)
primeiru_lim = texto[:5]
print("Medida:", medida)
print("Primeiru lima letra:", primeiru_lim)
```
3 changes: 3 additions & 0 deletions Operasaun no manipulasaun string/kode.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
mensagem = "Ola, mundu!"
comprimentu = len(mensagem)
print(comprimentu) # Sai 12
Loading