File tree Expand file tree Collapse file tree 3 files changed +42
-2
lines changed Expand file tree Collapse file tree 3 files changed +42
-2
lines changed Original file line number Diff line number Diff line change 88list = [name_one , name_two , name_three , name_four ]
99chosen = random .choice (list )
1010print (f'The student chosen to erase the board is { chosen } .' )
11+
12+
13+ #19: Um professor quer sortear um dos seus quatro alunos para apagar o quadro. Faça um programa que ajude ele, lendo o
14+ #nome dos alunos e escrevendo na tela o nome do escolhido.
15+ '''import random
16+ primeiro = str(input('Qual o nome do primeiro aluno:'))
17+ segundo = str(input('Qual o nome do segundo aluno:'))
18+ terceiro = str(input('Qual o nome do terceiro aluno:'))
19+ quarto = str(input('Qual o nome do quarto aluno:'))
20+ lista = [primeiro, segundo, terceiro, quarto]
21+ print(f'O aluno escolhido foi: {random.choice(lista)}')'''
22+
23+ #PT- Foi preciso importar o ramdom para misturar os dados da lista (e criar a lista) depois pedir ao programa para escolher
24+ #um dos dados informados da lista pelo comando choise.
25+ #EN-It was necessary to import the ramdom to mix the data from the list (and create the list) and then ask the program to
26+ # choose one of the data provided in the list by the choise command.
Original file line number Diff line number Diff line change 11#20- The same teacher from challenge 19 wants to draw the order in which the students' work will be presented. Make a program that
22# read the names of the four students and show the order drawn.
3- import random
3+ ''' import random
44first_name = str(input('First students name:'.strip()))
55second_name = str(input('Second students name:'.strip()))
66third_name = str(input('Third students name:'.strip()))
77fourth_name = str(input('Fourth students name:'.strip()))
88list = [first_name, second_name, third_name, fourth_name]
99random.shuffle(list)
1010print('The order of presentation of students will be:')
11- print (list )
11+ print(list)'''
12+
13+
14+ #20: O mesmo professor do desafio 19 quer sortear a ordem de apresentação de trabalhos dos alunos. Faça um programa
15+ #que leia o nome dos quatro alunos e mostre a ordem sorteada.
16+ import random
17+ primeiro = str (input ('Digite o nome do primeiro aluno:' ))
18+ segundo = str (input ('Digite o nome do segundo aluno:' ))
19+ terceiro = str (input ('Digite o nome do terceiro aluno:' ))
20+ quarto = str (input ('Digite o nome do quarto aluno:' ))
21+ lista = [primeiro , segundo , terceiro , quarto ]
22+ random .shuffle (lista )
23+ print (f'A ordem de apresentação dos trabalhos será: { lista } ' )
Original file line number Diff line number Diff line change 55pygame .mixer .music .load ('nana.mp3' )
66pygame .mixer .music .play ()
77pygame .quit ()
8+
9+
10+ #21: Faça um programa em Python que abra e reproduza o áudio de um arquivo MP3.
11+ import pygame
12+ pygame .init ()
13+ pygame .mixer .init ()
14+ pygame .mixer .music .load ('nana.mp3' )
15+ pygame .mixer .music .play ()
16+ pygame .quit ()
17+
18+ #PT- Treinando o uso de modulos, no caso math.
19+ #EN- Training the use of modules, in this case math
You can’t perform that action at this time.
0 commit comments