-
Notifications
You must be signed in to change notification settings - Fork 0
/
Mundo-01.py
1264 lines (1024 loc) · 40.3 KB
/
Mundo-01.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# This is a sample Python script.
# Press Shift+F10 to execute it or replace it with your code.
# Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings.
'''def print_hi(system):
# Use a breakpoint in the code line below to debug your script.
print(f'Hi, {system}') # Press Ctrl+F8 to toggle the breakpoint.'''
# Press the green button in the gutter to run the script.
import math
import random
import emoji
'''if __name__ == '__main__':
print_hi('PyCharm')'''
# See PyCharm help at https://www.jetbrains.com/help/pycharm/
# Coding: UTF-8
# exercicio 001 print o nome holla mundo
'''holla_mundo = "Hello World!"
print(holla_mundo)'''
# Testes de pycharm
'''def print_hi(system):
if(johhny == "gabriel"):
print("Hello World!")'''
# print_hi("Johnny") # test of function print_hi()
# Exercício Python 2: Faça um programa que leia o nome de uma pessoa e mostre uma mensagem de boas-vindas.
'''
nome = str(input("What is your system: "))
print("Seja bem-vindo, {}!" .format(nome))'''
'''start = print("Write down your system below! ")
system = input()
b = input("In case you write down your system, type 'y' for Yes and 'n' for No.")
saudacao = ("It's a pleasure to meet you, ")
if (b == "y"):
print(saudacao, system, "Program finished!")
else:
while(b != "n" or "y"):
start = print("Write down your system below, cause the letter", b, "it's not a variable avalible!")
system = input()
b = input("In case you write down your system, type 'y' for Yes and 'n' for No.")
saudacao = ("It's a pleasure to meet you, ")
'''
# I stopped on class number 06
'''n1 = int(input("Type a number: "))
n2 = int(input("Type a number: "))
s = n1 + n2
print("The sum between {} e {} é: {}".format(n1, n2, s))
print(type(n1))
# n3 = n1.isnumeric() # Dec
print(n3.isalpha())'''
'''numstr = '100' #numeric digits
print(numstr.isnumeric())
numstr = "j" #'\u0034' # \u0034 is 4
print(numstr.isnumeric())
numstr = '\u00BD' # \u0024 is ½
print(str.isnumeric())
numstr = '¾'
print(numstr.isnumeric())'''
'''a = input("Type anything: ")
if(a.isnumeric()):
print(a, "Is numeric")
if(a.isalnum()):
print(a, "is alphanumeric!")
else:
if(a.islower()):
print(a, "Is lower")
else:
if(a.isupper()):
print(a, "is upper")
else:
if(a.isspace()):
print(a, "is space")
else:
print(a, "Is str")'''
# Exercício Python 3: Crie um programa que leia dois números e mostre a soma entre eles.
'''n1 = int(input("Type a number: "))
n2 = int(input("Type a number: "))
s = n1 + n2
print("The sum between {} e {} é: {}".format(n1, n2, s))'''
# print(type(n1))
# Exercício Python 4: Faça um programa que leia algo pelo teclado
# e mostre na tela o seu tipo primitivo e todas as informações possíveis sobre ele.
'''a = input("Type anything: ")
print(type(a))
print("It is alphanumeric: {}" .format(a.isalnum()))
print("It is upper: {}" .format(a.isupper()))
print("It is lower: {}" .format(a.islower()))
print("It is space: {}" .format(a.isspace()))
# print("It is al: ", a.isalnum())
print("It is alpha: {}" .format(a.isalpha()))
print("It is captalizaded: {}" .format(a.istitle()))'''
'''if(a.isnumeric()):
print(a, "Is numeric")
if(a.isalnum()):
print(a, "is alphanumeric!")
else:
if(a.islower()):
print(a, "Is lower")
else:
if(a.isupper()):
print(a, "is upper")
else:
if(a.isspace()):
print(a, "is space")
else:
print(a, "Is str")'''
# Aula 07
# coding: utf-8
'''nome = str(input("What is your system: "))
print("Seja bem-vindo, {:=<50}!" .format(nome))'''
'''div = float(input("typw any number for divisor: "))
numr = float(input("Type any number for number"))
total = div / numr
print("The divisions between {} \ne {} \nis: {:.2f}\n".format(div, numr, total ), end=" >>> ")
print("This calculation is simple, \nis not it")
'''
'''num = float(input("Type here any number: "))
num2 = float(input("Type here another number wished: "))
ant = float(input("Type here any number: "))
suc = float(input("Type here any number: "))'''
'''print()
print("Your number chosen is {} and its predecessor is {} and successor is {}".format(num, num-1, num+1))
print()
print("Your number chosen is {} and its double is {} and its triple is {} and finally"
" its square root is "
"{}".format(num, num*2, num*3, num**(1/2)))
print()
print("Your first grade is {} and your second grade is {} then the media grade is {}".format(num, num2, (num+num2)/2))
print()'''
'''cal_conv = float(input("Choose any number in metres to convert in centimeters and minimitres: "))
print("You chose the number {:.2f}m and converted in centimeters is {:.2f}cm and in "
"minimeters is {:.2f}mm".format(cal_conv, cal_conv*100, cal_conv*1000))'''
'''tabuada = int(input("Type here any number for calculate its multiplication table: "))
# tabuada1 = int(input("Type here any number for calculate its multiplication table: "))
# tabuada2 = int(input("Type here any number for calculate its multiplication table: "))
# tabuada3 = int(input("Type here any number for calculate its multiplication table: "))
# tabuada4 = int(input("Type here any number for calculate its multiplication table: "))
# tabuada5 = int(input("Type here any number for calculate its multiplication table: "))
c1 = tabuada/1
c2 = tabuada/2
c3 = tabuada/3
c4 = tabuada/4
c5 = tabuada/5
c6 = tabuada/6
c7 = tabuada/7
c8 = tabuada/8
c9 = tabuada/9
c10 = tabuada/10
print("The multiplication table of the number have chosen for you is:")
print("---"*5)
print(tabuada,"/ 1 = {:2}".format(c1))
print(tabuada,"/ 2 = {:2}".format(c2))
print(tabuada,"/ 3 = {:2}".format(c3))
print(tabuada,"/ 4 = {:2}".format(c4))
print(tabuada,"/ 5 = {:2}".format(c5))
print(tabuada,"/ 6 = {:2}".format(c6))
print(tabuada,"/ 7 = {:2}".format(c7))
print(tabuada,"/ 8 = {:2}".format(c8))
print(tabuada,"/ 9 = {:2}".format(c9))
print(tabuada,"/ 10 = {:2}".format(c10))
print("---"*5)'''
# how much money have in the wallet and how much dollars can buy
# value of dollar is 3.27
'''have_wallet = float(input("Type here how much money do you have in your wallet in reais: "))
val_dor = 4.74
canBuy = have_wallet/val_dor
print("You've just R$ {:.2f} and you can just buy in dollars a few of $ {:.2f} ".format(have_wallet, canBuy))'''
# how many it is necessary of wall paint to paint the wall
'''length = float(input("Type here a length of your wall: "))
height = float(input("Type here a height of your wall: "))
one_litre_paint = 2
areWall = length * height
paintNecessary = areWall / one_litre_paint
print("Are total of your wall is {:.2f}m² so you have to {:.2f}lt "
"of wall paint to paint all your wall!".format(areWall, paintNecessary))'''
# Product price and its new price late of discont
'''product_price = float(input("Type here a price of the product you have encountered on the shelf: "))
percentage = (5/100) * product_price
discount = product_price - percentage
print("The price of the product is {:.2f} and with the discount of 5% (R$ {:.2f}), "
"the new price is R$ {:.2f}".format(product_price, percentage, discount))'''
# New salary/wage of the functionary increse of 15%
'''salary = float(input("Type here a price of the product you have encountered on the shelf: "))
percentage_increase = (15/100) * salary
new_salary = salary + percentage_increase
print("Your current wage is {:.2f} and with the increase of 15% (R$ {:.2f}), "
"your new salary is R$ {:.2f}".format(salary, percentage_increase, new_salary))'''
# Exercício Python 5: Faça um programa que leia um número Inteiro e mostre na tela o seu sucessor e seu antecessor.
'''num_int = int(input("Type a number: "))
print("The number typing is {}, so its predecessor is {} and its successor is {}".format(num_int, num_int-1, num_int+1))'''
# Exercício Python 006: Crie um algoritmo que leia um número e mostre o seu dobro, triplo e raiz quadrada.
'''sr = pow(64, (1/2))
print(sr)'''
# Exercício Python 14: Escreva um programa que converta uma temperatura digitando em graus Celsius e converta para graus Fahrenheit.
'''dc = float(input("How many degrees Celsius is it now: "))
converted = (dc*9)/5 + 32
print("Temperature in Celsius of {:.1f}ºC converted to fahrenheit is {:.1f}ºF.".format(dc, converted))'''
# Exercício Python 15: Escreva um programa que pergunte a quantidade de Km percorridos por um carro alugado e
# a quantidade de dias pelos quais ele foi alugado.
# Calcule o preço a pagar, sabendo que o carro custa R$60 por dia e R$0,15 por Km rodado.
'''km_traveled = float(input("What is the distance travel (in Km) for your car ?\n"))
rented_day = float(input("How many day do you have rented your car for ?\n"))
rent_value = (km_traveled * 0.15) + (rented_day * 60)
print("You have traveled for {:.2f} Km, during a period of {} day, "
"so the value total of your rent was R$ {:.2f}.".format(km_traveled, rented_day, rent_value))'''
# AULA 08
'''import math
num = float(input("Type a number: "))
sqrt = math.sqrt(num)'''
'''if(num == float(2)):
ceil = math.ceil(num)
sqrt = math.sqrt(num)
print(ceil, "e", sqrt)
else:
print("Square root is {}".format(math.sqrt(num)))'''
'''if(sqrt % 2 == 0 or sqrt % 2 == 1):
print("The square root of {:.0f} is {:.0f}.".format(num, sqrt))
else:
print("The square root of {:.2f} is {:.2f}.".format(num, sqrt))'''
'''from math import lcm, floor
aa = float(input("Type here a number: "))
bb = pow(aa, (1/2))
# a = lcm(bb)
b = floor(bb)
print(bb)
print("e", b)
# c = pow(aa, (1/2))
# print("e", b, "e", "{:.2f}.".format(c))
# print(c)
# print("the value is {:.2f}.".format(c))'''
'''import random
num = random.randint(0, 25)
print(num)'''
'''import emoji
print(emoji.emojize("Olá mundo :sungglasses: ", use_aliases=True))'''
# Coding: UTF-8
# challenge 16
'''radius = float(input("Type here a number for radius of the circle: "))
pi = math.pi
print("The value of π is {}.".format(pi))
c = radius*2*pi
print("So the value of circumference is {} ".format(c))
numInt = c/(2*radius)
# numInt = int(numFlo)
# ardPi = int(numInt)
# ardPi = math.trunc(numInt)
ardPi = numInt
print("The float number made by a calculation and converted to an entire number is {}.".format(int(ardPi)))'''
# challenge 17
# from math import hypot
'''catOp = float(input("Type here the opposite side of hypotenuse: "))
catAd = float(input("Type here the adjacent side of hypotenuse: "))
cal = catAd**2 + catOp**2
# hip = pow(cal, (1/2))
hip = math.hypot(catOp, catAd)
# hip = hypot(catOp, catAd)
print("The value of hypotenuse from {} (in opposite side) and {} (in adjacent side) is {:.2f}.".format(catOp, catAd, hip))'''
# challenge 18 -
'''catOp = float(input("Type here the opposite side of hypotenuse: "))
catAd = float(input("Type here the adjacent side of hypotenuse: "))
cal = catAd**2 + catOp**2
hip = pow(cal, (1/2))
print("The value of hypotenuse from {} (in opposite side) and {} (in adjacent side) is {}.".format(catOp, catAd, hip))
deg = float(input("Enter with a degree to calculate its sin, cos and tangent: "))
print("The value of sin of the degree {} is {}".format(deg, math.sin(deg)))
sin = catOp / hip
resultSin= math.sin(sin)
print("The value of sin is {}.".format(resultSin))
cos = catAd / hip
resultCos = math.cos(cos)
print("The value of cos is {}.".format(resultCos))
tang = catOp / catAd
resultTang = math.tan(tang)
print("The value of tangent is {}".format(resultTang))'''
# import math
# from math import cos, radians, sin, tan
'''degree2 = int(input("Enter with a degree to calculate its sin, cos and tangent:"))
# degree = math.radians(degree2)
a = math.sin(math.radians(degree2))
b = math.cos(math.radians(degree2))
c = math.tan(math.radians(degree2))
print("The value of sin is {:.2f}, cos is {:.2f} and tangent is {:.2f}".format(a, b, c))'''
# students = list[input("Enter here with the names of students: ")]
'''from random import choice
student1 = str((input("Enter with the system of the first student (number 1): ")))
student2 = str((input("Enter with the system of the second student (number 2): ")))
student3 = str((input("Enter with the system of the third student (number 3): ")))
student4 = str((input("Enter with the system of the fourth student (number 4): ")))
lista = [student4, student3, student2, student1]
chosen = choice(lista)
print("The student chosen was: {}".format(chosen))'''
'''student1 = 1
student2 = 2
student3 = 3
student4 = 4
lucky = random.randint(student1, student4) # input("Enter here with the names of students: "))
print("Lucky student was: {}".format(lucky))'''
# challenge 19
'''from random import shuffle
a = input("Enter here with the system of the fist group: ")
b = input("Enter here with the system of the second group: ")
c = input("Enter here with the system of the third group: ")
d = input("Enter here with the system of the fourth group: ")
list = [a, b, c, d]
shuffle(list)
print("The group chosen was: {}".format(list))'''
'''aa = random.randint(1, 4), random.randint(1, 4), random.randint(1, 4), random.randint(1, 4)
bb = random.randint(1, 4)
cc = random.randint(1, 4)
dd = random.randint(1, 4)
print(aa)'''
'''a = int(1)
b = int(2)
c = int(3)
d = int(4)'''
'''for e in random.randrange(aa, dd, 1):
print("The first group to presentation is: {}.".format(e))
print("The second group to presentation is: {}.".format(e))
print("The third group to presentation is: {}.".format(e))
print("The fourth group to presentation is: {}.".format(e))'''
# Exercício Python 21: Faça um programa em Python que abra e reproduza o áudio de um arquivo MP3.
'''import pygame
import os
pygame.init()
if(os.path.exists("Track 06.mp3")):
# pygame.mixer.init()
pygame.mixer.music.load("Track 06.mp3")
pygame.mixer.music.play()
pygame.event.wait()
pygame.mixer.music.set_volume(1)
clock = pygame.time.Clock()
clock.tick(10)
while(pygame.mixer.music.get_busy()):
pygame.event.poll()
clock.tick(10)
else:
print("File is not encountered in the paste!")'''
'''import playsound
playsound.playsound("Track01")'''
# Aula 09
# system = "johnny gabriel pereira marcelino"
# dict(system)
# print(system, 0)
'''system = "Johnny gabriel pereira marcelino"
print(system)
print(len(system))
print(len(system[4:15]))
print(system.count("p"))
print(system.count("o", 0, 31))
print(system.find("mar"))
print(system.find("hello")) # Not encountered return -1
a = "johnny" in system
print(a)
b = system.replace("pereira", "style")
print(b)
all_upper = system.upper()
print(all_upper)
all_lower = system.lower()
print(all_lower)
cap = system.capitalize()
print(cap)
titl = system.title()
print(titl)
name1 = " maria de fatima "
print(name1)
c = name1.strip()
print(c)
d = c.title()
print(d)
print(name1)
print(name1.rstrip())
print(name1.lstrip())
nameMy = "Johnny gabriel pereira marcelino"
print(nameMy.split())
print("".join(nameMy))'''
'''n = "Johnny gabriel pereira marcelino "
print(n.upper().count("P"))
print(len(n.strip("o")))
print(n.strip("Johnny "))
print(n.replace("e", "o"))
print(n[n.count("o")])
print(n.count("o"))
an = n.replace("Johnny", "jorge")
print(an)
print("johnny" in n)
print(n.lower().find("johnny"))
cut = n.rstrip()
list = cut.split()
print(list[2][4])'''
# challenges
# Challenge 22
'''system = str(input("Enter here with your full system: "))
print(system)
print("Your system in uppercase is {}".format(system.upper()))
print("Your system in lowercase is {}".format(system.lower()))
print("Your system have {} lyrics".format(len(system.replace(" ", ""))))
name1 = system.split()
print(len(name1[0]))
print(len(list(system)))'''
# Challenge 23
# Mathmaticsy
'''number = int(input("Enter with a number between 0 and 99999: "))
rn = number.split()
print(rn[1])
u = number // 1 % 10
t = number // 10 % 10
h = number // 100 % 10
th = number // 1000 % 10
print("Your unit is {}".format(u))
print("Your tens is {}".format(t))
print("Your hundreds is {}".format(h))
print("Your thousands is {}".format(th))'''
'''split_number = number.__str__()
number_list = split_number.split()
# print(number_list[0][1])
print("Number represented as unit is {}, as tens is {}, as hundreds is {}, "
"as thousands is {} and unit of thousands is {}"
.format(number_list[0][4], number_list[0][3], number_list[0][2], number_list[0][1], number_list[0][0]))'''
'''total = split_number.replace("","-")
total1 = total.rstrip("-")
total2 = total1.lstrip("-")
# total2 = int()
print("Number represented as unit is {}, as tens is {}, as hundreds is {}, as thousands is {} "
"and unit of thousands is {}".format(total2[5], total2[4], total2[3],total2[2], total2[1]))'''
# print(total2[0])
# Challenge 24
'''cidade = input("What city do you live? :")
# cidade1 = input("What was your last city did you live?")
upper = cidade.upper()
inSant = upper.split()
sant = inSant[0]
haveSant = "SANTO" in sant
print("Whether 'Santo' was into in your first city system, the value 'False' = 'Not', "
"and 'True' = 'Yes', then this answered: \n{}!".format(haveSant))'''
# temSanto = "Santo" in cidade
# print("If 'Santo' was into in your city, the value 'False' = 'Not', and 'True' = 'Yes', then this answered: {}".format(temSanto))
# Challenge 25
'''system = input("Enter here with your system: ").strip().upper()
in_silva = "SILVA" in system
print("Have your system has 'Silva': {}!".format(in_silva))'''
# Challenge 26
'''enter = str(input("Enter here with any phrase: ")).strip().upper()
print("Total of letters is: {}".format(len(enter)))
print("Letter 'a' was written in the phrase ?: {}".format("A" in enter))
print("What is the first position of the letter 'a' in the phrase: {}".format(enter.find("A")+1))
print("What is the last position of the letter 'a' in the phrase: {}".format(enter.rfind("A")+1))
print("How many times the letter 'a' appears in the phrase: {}".format(enter.count("A")))'''
'''lista = enter.split()
b = lista[-1]
count = b.count("A")
print(count)'''
# print(lista[-1])
# a = len(enter)
# a = enter.count("a")
'''splitA = enter.split()
print(splitA)
print(len(splitA))'''
# print("The last position of the letter 'A' is", len(splitA)])
# countA =
# print(countA)
# a = countA
# print(a)
# print(countA)
# lastA =
# print(enter.find(enter.count("a")))
# Challenge 27
'''fullname = str(input("Enter with your full system: ")).strip().upper()
a = fullname.split()
print("Your first system is {}, and the last system is {}".format(a[0], a[-1]))
print(a[0], a[-1])
# print(a[-1])'''
# AULA 10
'''system = str(input("Enter with your first system: ")).strip().upper()
if(system == "JOHNNY"):
print("What a beafully system you have! ")
print("Good Morning {}.".format(system))'''
# Challenge 28
'''from random import randint
from time import sleep
random_number = randint(0, 5)
print("I am going to draw in a number!\nGuess up!")
chosen_number = int(input("Choice a number between 0 to 5, to guess up the number chosen by the program: "))
print("PROCESSING...")
sleep(3)
if(chosen_number == random_number):
print()
print("WELL DONE!")
print()
print("The number chosen by you was {} and the program number was {}".format(chosen_number, random_number))
print()
print("Congrats! You have just guessed up the number chosen by the program!")
else:
print()
print("GAME OVER")
print()
print("The number chosen by you was {} and the program number was {}".format(chosen_number, random_number))
print()
print("I'm sorry! You do not guessed the number up!")
print()
print("Try the next time!")'''
# Coding: UTF-8
# Challenge 29
'''car_speed = int(input("Whats is the speed of your car in Km: "))
limit_speed = 79
if(car_speed >= 80):
traffic_value = (7 * (car_speed - 79))
print("You were penalized!")
print("The speed of your car is {} Km/h and the speed limit in this highway is {} Km/h!".format(car_speed, limit_speed))
print("So you committed a traffic violation!")
print("The value of your traffic violation exceeded is {:.2f} R$!".format(traffic_value))
else:
print("You were not penalized!\nHave a good day!")
print("The speed limit in this highway is {} Km/h and you were in a speed of {} Km/h!".format(limit_speed, car_speed))'''
# Challenge 30
'''num = int(input("Choice a number: "))
if(num % 2 == 1):
print("The number chosen is odd")
else:
print("The number chosen is even!")'''
# Challenge 31
'''travel = float(input("What is the distance of your trip in Km ? "))
limit_trip = 200
if(travel <= limit_trip):
ticket_trip = 0.50
print("The value of your trip is {:.2f} R$".format(ticket_trip*travel))
else:
ticket1_trip = 0.45
print("The value of your trip is {:.2f} R$".format(ticket1_trip*travel))'''
# Challenge 32
'''from datetime import date
year = int(input("Witch are your year? Choice the number 0 to choose the current year: "))
# year // 4
if(year == 0):
year = date.today().year
if(year % 4 == 0 and year % 100 != 0 and year % 400 != 0):
print("This is a leap year {}!".format(year))
else:
print("This in not a leap year {}!".format(year))'''
# Challenge 33
'''num1 = float(input("Choice the first number: "))
num2 = float(input("Choice the second number: "))
num3 = float(input("Choice the third number: "))
if(num1 > num2 and num1 > num3):
print("The number {} is upper than {} and {}".format(num1, num2, num3))
else:
if (num2 > num1 and num2 > num3):
print("The number {} is upper than {} and {}".format(num2, num1, num3))
else:
if (num3 > num1 and num3 > num2):
print("The number {} is upper than {} and {}".format(num3, num1, num2))
if(num1 == num2 and num1 == num3):
print("Both numbers are igual!")'''
# Challenge 34
'''current_salary = float(input("How much do you make: "))
limit = 1250
percentage1 = 10/100
percentage2 = 15/100
if(current_salary > limit):
future_salary = (current_salary * percentage1) + current_salary
increase = percentage1 * current_salary
print("You have an increased in your salary of {:.2f} R$, then your new salary is {:.2f} R$".format(increase, future_salary))
else:
if(current_salary <= limit):
future_salary = (current_salary * percentage2) + current_salary
increase = percentage2 * current_salary
print("You have an increased in your salary of {:.2f} R$, "
"then your new salary is {:.2f} R$".format(increase, future_salary))'''
# Challenge 35
# precisa-se ser menor do que a soma de todos os outros
'''tr1 = float(input("Enter with your first length of the triangle: "))
tr2 = float(input("Enter with your second length of the triangle: "))
tr3 = float(input("Enter with your third length of the triangle: "))
if(((tr2) + (tr3)) > tr1):
print("YES!\nThese measures can form a triangle!")
else:
if (((tr1) + (tr3)) > tr2):
print("YES!\nThese measures can form a triangle!")
else:
if (((tr1) + (tr2)) > tr3):
print("YES!\nThese measures can form a triangle!")
else:
print("NO!\nThese measures can not form a triangle!")'''
# AULA 11
'''colors = input("\033[7;30;44m Enter with your system: \033[m")
print("\033[4;33;47m", colors, "\033[m")
a = 10
b = 20
print("The values are \033[35m{} and \033[30;44m{}\033[30;44m".format(a, b),"\033[m")
system = input("Type your system: ")
print("It's a pleasure to meet you, {}{}{}!".format("\033[4;34m", system, "\033[m"))'''
# AULA 12
'''if():
elif():
else:'''
# CHALLENGE 36
'''house_price = float(input("How much is it the house ? "))
salary_wisher = float(input("How much do you make for month ? "))
years_payment = int(input("How many years will you pay the house for ? "))
payment_request = (house_price / years_payment) / 12
# print(payment_request)
total = (payment_request * (30 / 100)) + payment_request
# month_payment = salary_wisher * 30/100
if(salary_wisher > total):
print("I am sorry! Your request was recused!")
print("Your salary is lower than requested!", end=" ")
print("The value of the times is {:.2f}".format(payment_request))
else:
if(salary_wisher <= total):
print("Congrats!!!")
print("Your request was allowed!!!", end=" ")
print("The value of the times is {:.2f}".format(payment_request))'''
# CHALLENGE 37
'''chosen = int(input("Enter with any number would you like to convert: "))
convert = int(input(''' '''What system would you like to convert the number {} ?
Type: '1' for binary system
Type: '2' for octal system
Type: '3' for hexadecimal system: ''' #.format(chosen)))
'''if(convert == 1):
print("The number {} converted to binary system is {}!".format(chosen, bin(chosen)[2:]))
elif(convert == 2):
print("The number {} converted to octal system is {}!".format(chosen, oct(chosen)[2:]))
elif(convert == 3):
print("The number {} converted to hexadecimal system is {}!".format(chosen, hex(chosen)[2:]))
else:
print("Option does not available!")'''
# ascii(4)
# print(ascii())
# print(bin(7))
# CHALLENGE 38
'''chosen = int(input("Enter with the first number: "))
chosen1 = int(input("Enter with the second number: "))
if(chosen > chosen1):
print("The first value {} is greater than the second value {}!".format(chosen, chosen1))
elif(chosen1 > chosen):
print("The second value {} is greater than the first value {}!".format(chosen1, chosen))
else:
print("Both values {} and {}, are equals!".format(chosen, chosen1))'''
# CHALLENGE 39
'''from datetime import date
current = date.today().year
birth_age = int(input("Which year did you birth ? "))
enlist = current - birth_age
if(birth_age < enlist):
print("You are not already to enlist for while!")
print("It's left {} years for you enlist".format((current - birth_age) - 18))
elif(birth_age == enlist):
print("This age mean you are already to enlist!")
elif(birth_age > enlist):
print("This age overcome the ideal age to enlist!")
print("It's already passed {} years to enlist!".format((current - birth_age) - 18))'''
# CHALLENGE 40
'''system = str(input("What is your system ? "))
grade = float(input("Whats is your first grade in this semester {} ? ".format(system)))
grade1 = float(input("Whats is your second grade in this semester {} ? ".format(system)))
media = (grade + grade1) / 2
reproved = 5
recovery = 6.9
approved = 7
if(media >= approved):
print("CONGRATS!")
print("You have been approved {} !!".format(system))
print("Your media final in this semester was {}!".format(media))
elif(media >= reproved and media <= recovery):
print("{}, I hope you study more!".format(system))
print("You are in recovery!!")
print("Your media final in this semester was {}!".format(media))
elif(media < reproved):
print("I AM SORRY {}!!!".format(system))
print("You have not passed!!!")
print("Your media final in this semester was {}!".format(media))'''
# CHALLENGE 41
'''from datetime import date
system = str(input("What is your system ? "))
birth_year = int(input("Which year did you birth ? "))
current_year = date.today().year
mirim = 9
infantil = 14
junior = 19
senior = 20
# master = 21
if(current_year - birth_year <= mirim):
print("You are in the category of 'MIRIM'!!")
print("You are {} years old!".format(current_year - birth_year))
elif(current_year - birth_year > mirim and current_year - birth_year <= infantil):
print("You are in the category of 'INFANTIL'!!")
print("You are {} years old!".format(current_year - birth_year))
elif(current_year - birth_year > infantil and current_year - birth_year <= junior):
print("You are in the category of 'JUNIOR'!!")
print("You are {} years old!".format(current_year - birth_year))
elif(current_year - birth_year > junior and current_year - birth_year <= senior):
print("You are in the category of 'SENIOR'!!")
print("You are {} years old!".format(current_year - birth_year))
elif(current_year - birth_year > senior):
print("You are in the category of 'MASTER'!!")
print("You are {} years old!".format(current_year - birth_year))'''
# CHALLENGE 42
# Coding: UTF-8
'''tr1 = float(input("Enter with your first length of the triangle: "))
tr2 = float(input("Enter with your second length of the triangle: "))
tr3 = float(input("Enter with your third length of the triangle: "))
if((tr2) + (tr3) > tr1 and (tr1) + (tr3) > tr2 and (tr1) + (tr2) > tr3 and tr1 == tr2 == tr3):
print("YES!\nThese measures can form a triangle!")
print("This is a equilateral triangle!")
elif((tr2) + (tr3) > tr1 and (tr1) + (tr3) > tr2 and (tr1) + (tr2) > tr3 and tr1 == tr2 or tr3 == tr1 or tr3 == tr2):
print("YES!\nThese measures can form a triangle!")
print("This is a isosceles triangle!")
elif((tr2) + (tr3) > tr1 and (tr1) + (tr3) > tr2 and (tr1) + (tr2) > tr3 and tr1 != tr2 != tr3 != tr1):
print("YES!\nThese measures can form a triangle!")
print("This is a scalene triangle!")
else:
print("NO!\nThese measures can not form a triangle!")
'''
# CHALLENGE 43
# massa corpórea
'''weight = float(input("how much do you weight ? \n"))
height = float(input("how tall are you ? \n"))
imc = (weight / (height**2))
print("The MCI of this person is {:.2f}".format(imc))
if((imc) < 18.5):
print("You are on under weight of {:.2f}!".format(imc))
elif((imc) >= 18.5 and imc <= 25):
print("You are on ideal weight of {:.2f}!".format(imc))
elif((imc) > 25 and imc <= 30):
print("You are on overweight of {:.2f}!".format(imc))
elif((imc) > 30 and imc <= 40):
print("You are on obesity of {:.2f}!".format(imc))
elif((imc) > 40):
print("You are on morbid obesity of {:.2f}!".format(imc))'''
# CHALLENGE 44
'''print("{:*^40}".format(" lojas johnny!! "))
print("How will you pay this product ? ")
product_price = int(input("How much was your things ? "))
# question_condition = float(input("How will you pay this product ? "))
pay_condition = str(input("For cash payment type: 'CT', for check payment type: 'CA', for credit card type: 'CC', "
"for on credit card 2X type: 'C2' and for on credit card 3X type: 'C3'! ")).strip().upper()
ct = product_price - (product_price * 10/100)
ca = product_price
cc = product_price + (product_price * 5/100)
c2 = product_price + (product_price * 10/100)
c3 = product_price + (product_price * 20/100)'''
'''while(pay_condition != "CT" and pay_condition != "CA" and pay_condition != "CC" and pay_condition != "C2" and pay_condition != "C3"):
pay_condition = str(input("For cash payment type: 'CT', for check payment type: 'CA', for credit card type: 'CC', "
"for on credit card 2X type: 'C2' and for on credit card 3X type: 'C3'! ")).strip().upper()
ct = product_price - (product_price * 10 / 100)
ca = product_price
cc = product_price + (product_price * 5 / 100)
c2 = product_price + (product_price * 10 / 100)
c3 = product_price + (product_price * 15 / 100)
print("The price of product is {} reais".format(product_price))'''
'''if(pay_condition == "CT"):
print("You have a discount of {:.2f} R$, so you have to pay by this product {:.2f}!".format(product_price * 10/100, ct))
elif(pay_condition == "CA"):
print("You don't have a discount on this product, so you have to pay by this product {:.2f}!".format(ca))
elif(pay_condition == "CC"):
print("You have a increased of {:.2f} R$ on the price product, so you have to pay by "
"this product {:.2f}!".format(product_price * 5/100, cc))
elif(pay_condition == "C2"):
print("You have a increased of {:.2f} R$ on the price product, so you have to pay by "
"this product {:.2f}!".format(product_price * 10/100, c2))
elif(pay_condition == "C3"):
print("You have a increased of {:.2f} R$ on the price product, so you have to pay by "
"this product {:.2f}!".format(product_price * 15/100, c3))
else:
# print(pay_condition != ("CT" or "CA" or "CC" or "C2" or "C3"))
print("I am a legend")'''
# CHALLENGE 45
'''from random import randint
from time import sleep
itens = ("STONE", "PAPER", "SCISSOR")
machine = randint(0, 2)
print(''' '''Your choices are:
[ 0 ] STONE
[ 1 ] PAPER
[ 2 ] SCISSOR)'''
'''user = int(input("What is your choice to play with the machine!\n"))
print("JO")
sleep(1)
print("KEN")
sleep(1)
print("PÔ")
sleep(1)
print("="*30)
print("You have chosen {}".format(itens[user]))
print("Computer have chosen {}".format(itens[machine]))
print("="*30)'''
'''choice = str(input("Choose '0' for stone, '1' for paper or '2' for scissor to play with the machine! "))
machine = random.randint(0, 2)
# print(machine)
computer = str(machine)
# print(computer)
stone = '0'
paper = '1'
scissor = '2'''
'''if(user == machine):
print("Computer have chosen {}".format(machine))
print("You have chosen {}".format(user))
print("The game tied!")
elif(user == "0" and machine == '1' and user == "1" and machine == '2' and user == "1" and machine == '0'):
print("Computer have chosen {}".format(machine))
print("You have chosen {}".format(user))
print("YOU DEFEATED!\nTHE COMPUTER WIN!")
elif(machine == "1" and user == '0' and machine == "2" and user == '1' and machine == "0" and user == '1'):
print("Computer have chosen {}".format(machine))
print("You have chosen{}".format(user))
print("CONGRATS!!\nYOU WIN!")'''
# AULA 13