Skip to content

Commit 7566aca

Browse files
committed
Updated
From portuguese to english.
1 parent 7021192 commit 7566aca

File tree

9 files changed

+62
-62
lines changed

9 files changed

+62
-62
lines changed

ex016.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#Crie um programa que leia um número real qualquer pelo teclado e mostre na tela a sua porção inteira.
1+
# Create a program that reads any real number from the keyboard and displays its entire portion on the screen.
22
import math
3-
num = float(input('Digite um valor:'))
4-
print('O valor digitado foi {} e sua parte inteira é {}.'.format(num, math.trunc(num)))
3+
number = float(input('Enter a value:'))
4+
print('The value typed was {} and its entire part is {}.'.format(number, math.trunc(number)))

ex017.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# Faça um programa que leia o comprimento do cateto oposto e do cateto adjacente de um triângulo retângulo. Calcule e
2-
# mostre o comprimento da hipotenusa.
1+
# Write a program that reads the length of the opposite and adjacent sides of a right triangle. Calculate and
2+
# show the length of the hypotenuse.
33
import math
4-
co = float(input('Digite o valor do cateto oposto do triângulo:'))
5-
ca = float(input('Digite o valor do cateto adjacente do triângulo:'))
6-
hi = math.hypot(co,ca)
7-
print('O valor do cateto oposto é {} e o do cateto adjacente é {}, logo a sua hipotenusa é {:.2f}.'.format(co, ca, hi))
4+
opposite_side = float(input('Enter the value of opposite side of triangle:'))
5+
adjacent_leg = float(input('Enter the value of adjacente leg of triangle:'))
6+
hypotenuse = math.hypot(opposite_side,adjacent_leg)
7+
print('The value of opposite side is {} and the value of adjacent leg is {}, its hypotenuse is {:.2f}.'.format(opposite_side, adjacent_leg, hypotenuse))

ex018.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# Faça um programa que leia o ângulo qualquer e mostre na tela o valor do seno, cosseno e tangente desse ângulo.
1+
# Write a program that reads any angle and displays on the screen the value of the sine, cosine and tangent of that angle.
22
import math
3-
ang = float(input('Digite o valor de um ângulo qualquer:'))
4-
seno = math.sin(math.radians(ang))
5-
print('O valor do SENO é {:.2f}.'.format(seno))
6-
cos = math.cos(math.radians(ang))
7-
print('O valor do COSSENO é {:.2f}'.format(cos))
8-
tan = math.tan(math.radians(ang))
9-
print('O valor da TANGENTE é de {:.2f}'.format(tan))
3+
angle = float(input('Enter a value of an angle:'))
4+
sine = math.sin(math.radians(angle))
5+
print('The value of sine is {:.2f}.'.format(sine))
6+
cosine = math.cos(math.radians(angle))
7+
print('The value of cosine is {:.2f}'.format(cosine))
8+
tangent = math.tan(math.radians(angle))
9+
print('The value of tangent is {:.2f}'.format(tangent))

ex019.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# Um professor quer sortear um dos seus quatro alunos para apagar o quadro. Faça um programa que ajude ele, lendo o
2-
# nome dos alunos e escrevendo na tela o nome do escolhido.
1+
# A teacher wants to draw one of his four students to erase the board. Make a program that helps him, reading the
2+
# name of the students and writing the name of the chosen one on the screen.
33
import random
4-
a1 = str(input('Nome do primeiro aluno:'))
5-
a2 = str(input('Nome do segundo aluno:'))
6-
a3 = str(input('Nome do terceiro aluno:'))
7-
a4 = str(input('Digite o nome do quarto aluno:'))
8-
lista = [a1, a2, a3, a4]
9-
escolhido = random.choice(lista)
10-
print('O aluno escolhido para apagar o quadro é {}.'.format(escolhido))
4+
name_one = str(input('First students name:'))
5+
name_two = str(input('Second students name:'))
6+
name_three = str(input('Third students name:'))
7+
name_four = str(input('Fourth students name:'))
8+
list = [name_one, name_two, name_three, name_four]
9+
chosen = random.choice(list)
10+
print(f'The student chosen to erase the board is {chosen}.')

ex020.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# O mesmo professor do desafio 19 quer sortear a ordem de apresentação de trabalhos dos alunos. Faça um programa que
2-
# leia o nome dos quatro alunos e mostre a ordem sorteada.
1+
# The same teacher from challenge 19 wants to draw the order in which the students' work will be presented. Make a program that
2+
# read the names of the four students and show the order drawn.
33
import random
4-
a1 = str(input('Digite o nome do primeiro aluno:'.strip()))
5-
a2 = str(input('Digite o nome do segundo aluno:'.strip()))
6-
a3 = str(input('Digite o nome do terceiro aluno:'.strip()))
7-
a4 = str(input('Digite o nome do quarto aluno:'.strip()))
8-
lista = [a1, a2, a3, a4]
9-
random.shuffle(lista)
10-
print('A ordem de apresentação dos alunos será:')
11-
print(lista)
4+
first_name = str(input('First students name:'.strip()))
5+
second_name = str(input('Second students name:'.strip()))
6+
third_name = str(input('Third students name:'.strip()))
7+
fourth_name = str(input('Fourth students name:'.strip()))
8+
list = [first_name, second_name, third_name, fourth_name]
9+
random.shuffle(list)
10+
print('The order of presentation of students will be:')
11+
print(list)

ex021.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Faça um programa em Python que abra e reproduza o áudio de um arquivo MP3.
1+
# Write a Python program that opens and plays audio from an MP3 file.
22
import pygame
33
pygame.init()
44
pygame.mixer.init()

ex022.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
#Crie um programa que leia o nome completo de uma pessoa e mostre:
2-
# - O nome com todas as letras maiúsculas e minúscula.
3-
# - Quantas letras ao todo(sem considerar espaços).
4-
# - Quantas letras tem o primeiro nome.
5-
nome = str(input('Digite seu nome completo:'))
6-
print('Analisando seu nome...')
7-
print('Seu nome em maiúsculo é:{}.'.format(nome.upper()))
8-
print('Seu nome em minúsculo é:{}.'.format(nome.lower()))
9-
print('Seeu nome ao todo tem {} letras.'.format(len(nome)-nome.count(' ')))
10-
separa =nome.split()
11-
print('Seu primeiro nome é {} e ele tem {} letras.'.format(separa[0], len(separa[0])))
1+
#Create a program that reads a person's full name and displays:
2+
# - The name in all upper and lower case letters.
3+
# - How many letters in total without considering spaces
4+
# - How many letters are in the first name.
5+
name = str(input('Enter your full name:'))
6+
print('Analyzing your name...')
7+
print(f'Your name in capital letters:{name.upper()}.')
8+
print(f'Your name in lower case:{name.lower()}.')
9+
print(f'Your name in total has {len(name)-name.count(' ')} letters.')
10+
separate = name.split()
11+
print(f'Your first name is {separate[0]} and he has {len(separate[0])} letters.')

ex023.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
#Faça um programa que leia um número de 0 a 9999 e mostre na tela cada um dos dígitos separados.
2-
num = int(input('Informe um número:'))
3-
u = num // 1 % 10
4-
d = num // 10 % 10
5-
c = num // 100 % 10
6-
m = num // 1000 % 10
7-
print(f'Analisando o número {num}.')
8-
print(f'Sua unidade é {u}.')
9-
print(f'Sua dezena é {d}.')
10-
print(f'Sua centena é {c}.')
11-
print(f'Seu milhar é {m}.')
1+
# Write a program that reads a number from 0 to 9999 and displays each of the separate digits on the screen.
2+
number = int(input('Informe um número:'))
3+
unit = number // 1 % 10
4+
ten = number // 10 % 10
5+
hundred = number // 100 % 10
6+
thousand = number // 1000 % 10
7+
print(f'Analyzing your number: {number}.')
8+
print(f'Your unit is {unit}.')
9+
print(f'Your ten is {ten}.')
10+
print(f'Your hundred is {hundred}.')
11+
print(f'Your thousand is {thousand}.')

ex024.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
#Crie um programa que leia o nome de uma cidade e diga se ela começa ou não com o nome 'Santo'.
2-
cid = str(input('Em que cidade você nasceu?')).strip()
3-
print(cid[:5].upper() == 'SANTO')
1+
# Create a program that reads the name of a city and says whether or not it starts with the name 'Saint'.
2+
city = str(input('What city were you born?')).strip()
3+
print(city[:5].upper() == 'SAINT')

0 commit comments

Comments
 (0)