<jupyter_start><jupyter_text><jupyter_code>txt = "PETR3.SA"
x = txt.replace("3", "4", 1)
x
rent_anual_perc = 20.9
txt="A sua carteira obteve umar entabilidade anual de "
txt

print(txt + str(rent_anual_perc) + "%")
txt = "PETR3.SA"
x = txt[1:4]

x
txt = "   PETR3.SA   "
x = txt.strip()

x
txt = "petroleo brasileiro sa"
x = txt.upper()

x
x = "PETR3.SA"
print(len(x))
print(6**2)
print(10%4)
if 5 != 10:
    print("cu")
print("ITUB3.SA" == 'ITUB3.SA')
txt = "PETR3.SA"
x = txt[1]

x
txt = "PETR3.SA"
x = txt.lower()

x
tickers_portifolio = ["ITUB3.SA", "PETR3.SA"]

if "PETR3.SA" in tickers_portifolio:
    print("anus")
x =3
x+=1

x
tickers = ("ITUB3", "PETR3.SA", "ABEV3.SA")

list(tickers)[0] = "SULA11.SA"

print(tickers)


tickers = ["ITUB3.SA", "PETR3.SA"]
tickers.append("SULA11.SA")

tickers

itau_unibanco['website_br'] = 'itau.com.br'

tickers = ["ITUB3", "PETR3.SA", "ABEV3.SA"]

tickers.insert(1, "SULA11.SA")

print(len(tickers))

itau_unibanco = {
    "nome": "Itau Unibanco SA",
    "ano_fundacao": 20019
}

print(itau_unibanco["nome"])
def removeTicker(tickers):
    tickers.remove("PETR3.SA")


tickers = ["ITUB3", "PETR3.SA", "ABEV3.SA"]

removeTicker(tickers)

print(tickers)

tickers = ("ITUB3", "PETR3.SA", "ABEV3.SA")


print(tickers[2])

tickers = ["ITUB3", "PETR3.SA", "ABEV3.SA", "SULA11.SA"]
print(tickers[1:3])

itau_unibanco = {
    "nome": "Itau Unibanco SA",
    "ano_fundacao": 20019
}

itau_unibanco["nome"] = "Itau Unibanco S.A"

print(itau_unibanco["nome"])
tickers = ["ITUB3", "PETR3.SA", "ABEV3.SA"]
print(tickers[1])

import math as m
i = 1
for i in range(1,6):
    print(i)
    i = i +1
    break
class Empresa
tickers = ["ITUB3", "PETR3.SA", "ABEV3.SA"]

for x in tickers:
    print(x)

class Banco(Empresa):
    def __init__(self):
        Empresa.__init__(self)

alvo = 30.15
valor = 30.16

if valor >= alvo:
    print("venda")


x = 1

for i in range(0,10):
    print(x)

def consultaPrecoAtual(ticker):
    print(ticker)


consultaPrecoAtual("SULA11.SA") 
import math

x = math.pi

x
# AQUI
tickers = ["ITUB3", "PETR3.SA", "ABEV3.SA"]

y = list(tickers)
tickers[0] = "SULA11.SA"  

print(tickers)<jupyter_output>['SULA11.SA', 'PETR3.SA', 'ABEV3.SA']
{'fraction_non_alphanumeric': 0.19471044231646148, 'fraction_numerical': 0.04833561331509348, 'mean_word_length': 4.126168224299065, 'pattern_counts': {'":': 4, '<': 4, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '212764', 'license': 'MIT', 'n_tokens_mistral': 1109, 'n_tokens_neox': 1069, 'n_words': 203, 'path': '2021/FGV-Progamming-Logic/Quiz2_Coda.ipynb', 'repo_name': 'Muramatsu2602/python-bootcamp', 'size': '2193'}