Skip to content
Open
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
11 changes: 11 additions & 0 deletions exercicios/para-casa/SadProject.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from UsefulDate import Calculation
from UsefulDate import CalculateAge
from UsefulDate import LeapYear


sumAge = CalculateAge.CalculateAge(2023, 1996)
print(f"Bruna have {sumAge} age" )

sumLeapYear = LeapYear.leap_year(1996)
print(sumLeapYear)

2 changes: 2 additions & 0 deletions exercicios/para-casa/UsefulDate/CalculateAge.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def CalculateAge(current_year, year_born):
return current_year - year_born
11 changes: 11 additions & 0 deletions exercicios/para-casa/UsefulDate/Calculation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
def sum(a, b):
return a + b

def subtraction(a, b):
return a - b

def multiplication(a, b):
return a * b

def division(a, b):
return a / b
1 change: 1 addition & 0 deletions exercicios/para-casa/UsefulDate/FormatDate.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#IREI FAZER, TÁ? EU JURO
14 changes: 14 additions & 0 deletions exercicios/para-casa/UsefulDate/LeapYear.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from datetime import date

def leap_year(year):
if year%4 == 0:
if year % 100 == 0:
if year % 400 == 0:
return True
else:
print("Was born in a Leap year")
return True
else:
print("It wasn't a leap year")
return False

17 changes: 17 additions & 0 deletions exercicios/para-casa/UsefulDate/UsefulAge.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import csv
import json

data = []
def add_info_in_usefull():
age = input("Enter u age \n")

list ={age: int()}

data.append(list)

with open("dataAGE.py", "w", newline= "") as arq_csv:
writer_csv = csv.writer(arq_csv)
writer_csv.writerows(data)
return data

add_info_in_usefull()
17 changes: 17 additions & 0 deletions exercicios/para-casa/UsefulDate/UsefulYear-arq.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import csv
import json

data = []
def add_info_in_usefull():
year_born = input("Enter the year you were born \n")

list ={year_born: int()}

data.append(list)

with open("dataYEARBORN.py", "w", newline= "") as arq_csv:
writer_csv = csv.writer(arq_csv)
writer_csv.writerows(data)
return data

add_info_in_usefull()
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions exercicios/para-casa/UsefulDate/dataAGE.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
27
1 change: 1 addition & 0 deletions exercicios/para-casa/UsefulDate/dataYEARBORN.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1996
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
def sum(a, b):
return a + b

def subtraction(a, b):
return a - b

def multiplication(a, b):
return a * b

def division(a, b):
return a / b
Binary file not shown.
Binary file not shown.
12 changes: 12 additions & 0 deletions exercicios/para-sala/Exercise Package/ExerciseOne/MyCalculation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from Mathematics import Calculation

a = 3
b = 2

print(Calculation.sum(a, b))

print(Calculation.subtraction(a, b))

print(Calculation.multiplication(a, b))

print(Calculation.division(a, b))
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Beyonce,42,10
Bruna ,27,10
2 changes: 2 additions & 0 deletions exercicios/para-sala/Exercise in the Room/dataExerciseOne.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Bruna de Macedo Santos
Garota Gamer amante de World Of Warcraft
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Beyonce,42,10
Bruna,27,10
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"Name": "Beyonce", "Age": 42, "City": "Houston Texas", "Profission": "Singer, Performer and Actor", "Resume": "American singer, songwriter, and businesswoman. Known as Queen Bey, she has been widely recognized for her boundary pushing artistry, vocals, and performances. Her contributions to music and visual media and her concert performances have led her to become a prominent cultural figure of the 21st century. She was named the eighth greatest singer of all time by Rolling Stone in 2023."}]
42 changes: 42 additions & 0 deletions exercicios/para-sala/Exercise in the Room/manipulationExercise.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import csv
import json

#Exercise

# with open("./dataExerciseOne.txt", "r") as arq: #read
# content = arq.read()
# print(f"{content} - Bodecam")


# data = [{"Name": "Beyonce", "Age": 42, "City": "Houston Texas", "Profission": "Singer, Performer and Actor",
# "Resume": "American singer, songwriter, and businesswoman. Known as Queen Bey, she has been widely recognized for her boundary pushing artistry, vocals, and performances. Her contributions to music and visual media and her concert performances have led her to become a prominent cultural figure of the 21st century. She was named the eighth greatest singer of all time by Rolling Stone in 2023."}]
# with open("dataExerciseTwo.json", "w") as arquive_json:
# json.dump(data, arquive_json)
# with open("dataExerciseTwo.json", "r") as arquive_json:
# data = json.load(arquive_json)
# print(data)


data = [["Beyonce", 42, 10], ["Bruna ", 27, 10]]

# with open("dataExerciceStudants.csv", "w", newline= "") as arq_csv:
# writer_csv = csv.writer(arq_csv)
# writer_csv.writerows(data)

total_grade = 0
total_studants = 0

with open("dataExerciceStudants.csv", "r") as arq:
reader_csv = csv.reader(arq)
for line in reader_csv:
name, age, grade = line
grade = float(grade)
total_grade = total_grade + grade
total_studants = total_studants + 1

if total_studants > 0:
average = grade / total_studants
print(f"Average grade: {average}")

else:
print("No have studants in arquive")
Empty file.
Binary file not shown.
Binary file not shown.
5 changes: 5 additions & 0 deletions exercicios/para-sala/Package/PackageBodecam/moduleOne.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
def main():
return "Girls!!"

def sum(a, b):
return a + b
Empty file.
Binary file not shown.
Binary file not shown.
2 changes: 2 additions & 0 deletions exercicios/para-sala/Package/Sum/Motorcycle/sumMotorcycle.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def sum_motorcycle(quant_moto):
return quant_moto + 4
Empty file.
Binary file not shown.
Binary file not shown.
2 changes: 2 additions & 0 deletions exercicios/para-sala/Package/Sum/sumHouse.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def sum_house(quant_house):
return quant_house + 2
12 changes: 12 additions & 0 deletions exercicios/para-sala/Package/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from PackageBodecam import moduleOne
from Sum import sumHouse
from Sum.Motorcycle import sumMotorcycle

# info = moduleOne.main()
# print(info)

# my_sum = moduleOne.sum(1, 2)
# print(my_sum)

sum_motorcycle_bruna = sumMotorcycle.sum_motorcycle(1)
print(f"Bruna have {sum_motorcycle_bruna} motorcycles")
3 changes: 3 additions & 0 deletions exercicios/para-sala/Revision/Main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from PackageRevision import KilometersToMiles

print(KilometersToMiles.kilometer_to_miles(1000))
27 changes: 27 additions & 0 deletions exercicios/para-sala/Revision/Manipulation/Exercise.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import csv

books = []

#Para continuar salvando as informações passadas

with open("books.csv", "r") as arq:
writing = csv.reader(arq)
for line in writing:
title, author, year = line
books.append([title, author, year])

while True:
title = input("Enter title of book or exit")
if title.lower() == "exit":
print("Leaving of program")
break
author = input("Enter name author:\n")
year = input("Enter year of publish:\n")
books.append([title, author, year])

with open("books.csv", "w", newline="") as arq:
writing = csv.writer(arq)
writing.writerows(books)

if title.lower() != "Exit":
print("Information added successfully ")
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
def celsius_to_fahrenheit(fahrenheit):
celsius = (fahrenheit - 451 - 32) / 1.8
return celsius
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
def kilometer_to_miles(quilometers):
miles = quilometers / 1.609
return miles
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
def meteers_for_feets(meteers):
feets = meteers * 3.28084
return feets
Empty file.
2 changes: 2 additions & 0 deletions exercicios/para-sala/Room/data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[{"name": "Beyonce", "age": 42, "city": "Houston Texas"},
{"name": "Bruna", "age": 27, "city": "Sao Paulo"}]
5 changes: 5 additions & 0 deletions exercicios/para-sala/Room/data.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Beyoncé
Jay-z
Blue
Rummi
Carter
1 change: 1 addition & 0 deletions exercicios/para-sala/Room/dataOne.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
End line.
63 changes: 63 additions & 0 deletions exercicios/para-sala/Room/manipulation-arq.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import csv
# with open("./data.txt", "r") as arq: #read
# content = arq.read()
# print(f"{content} - Teacher")
# line = arq.readlines()
# print(line[2])


# with open("./dataOne.txt", "w") as arquive:
# arquive.write("End line.")


# data = [["name", "age"], ["Beyonce", 42], ["Bruna", 27]]

# with open("people.csv", "w", newline= "") as arq_csv:
# writer_csv = csv.writer(arq_csv)
# writer_csv.writerows(data)


# with open("people.csv", "r") as arq:
# reader_csv = csv.reader(arq)
# for line in reader_csv:
# print(line)


import json

# data = [{"name": "Beyonce", "age": 42, "city": "Houston Texas"},
# {"name": "Bruna", "age": 27, "city": "Sao Paulo"}]

# with open("data.json", "w") as arquive_json:
# json.dump(data, arquive_json)

# with open("data.json", "r") as arquive_json:
# data = json.load(arquive_json)
# print(data)

#Exercise

# with open("./dataExerciseOne.txt", "r") as arq: #read
# content = arq.read()
# print(f"{content} - Bodecam")


# data = [{"Name": "Beyonce", "Age": 42, "City": "Houston Texas", "Profission": "Singer, Performer and Actor",
# "Resume": "American singer, songwriter, and businesswoman. Known as Queen Bey, she has been widely recognized for her boundary pushing artistry, vocals, and performances. Her contributions to music and visual media and her concert performances have led her to become a prominent cultural figure of the 21st century. She was named the eighth greatest singer of all time by Rolling Stone in 2023."}]
# with open("dataExerciseTwo.json", "w") as arquive_json:
# json.dump(data, arquive_json)
# with open("dataExerciseTwo.json", "r") as arquive_json:
# data = json.load(arquive_json)
# print(data)


data = [["Name", "Age", "Grade"], ["Beyonce", 42, 10], ["Bruna", 27, 10]]

with open("dataExerciceStudants.csv", "w", newline= "") as arq_csv:
writer_csv = csv.writer(arq_csv)
writer_csv.writerows(data)

with open("dataExerciceStudants.csv", "r") as arq:
reader_csv = csv.reader(arq)
for line in reader_csv:
print(line)
3 changes: 3 additions & 0 deletions exercicios/para-sala/Room/people.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name,age
Beyonce,42
Bruna,27