-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmenu__aguilera.py
More file actions
1681 lines (1422 loc) · 53.3 KB
/
menu__aguilera.py
File metadata and controls
1681 lines (1422 loc) · 53.3 KB
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
import sys
#explanations for each code starts here
def act1_help():
print("""\n \033[1m
This code uses 'print' to create a diamond shape
code:
print("\ t\ t * \ n\ t\ t *
*\ n\ t\ t * * *\ n \ t * *
* * *\ n\ t\ t * * *\ n\ t\ t
* *\ n\ t\ t * ")
breakdown:
\ n and \ t are excape sequences.
\ n is used to create a new line without using another 'print'
\ t is for tab space
note: escape sequences work with this format '\ n'(no space between \ and n )
You can use space as tab space created by \ t isn't easy to align.\033[0m""")
def activity3_help():
print("""\n \033[1m
This program uses 'variable' to create question and will then be compiled later
code:
name = input("Please input your name:")
gender = input("Please input your gender:")
address = input("Please input your address:")
telephone = input("Please input your telephone number:")
cellphone = input("Please input your cellphone number:")
birthday = input("Please input your birthday:")
civil_status = input("Please input your civil status:")
birth_place = input("Please input your birth place:")
citizenship = input("Please input your citizenship:")
height = input("Please input your height:")
weight = input("Please input your weight:")
religion = input("Please input your religion:")
occupation = input("Please input your occupation:")
language = input("Please input languages that you speak:")
elementary = input("Please input your school in Elementary:")
elemgrad = input("When did you graduate?:")
high_school = input("Please input your school in High School:")
hsgrad = input("When did you graduate?:")
college = input("Please your school in College:")
collegegrad = input("When did you graduate?:")
degree = input("Please input the degree/s you achieved:")
company = input("Please input your company name:")
position = input("Please input your position:")
companyfrom = input("When did you start:")
companyto = input("When did you leave:")
charrefname = input("Please input the name of your characther reference:")
charcompany = input("Please input his/her company:")
charposition = input("Please input his/her position:")
charcontact = input("Please input his/her number:")
print("")
print("\ t\ t\ t\ t\ t\ t-----BIODATA-----")
print(" ")
print("PERSONAL INFORMATION")
print("")
print("Name: "+name)
print("Gender: "+gender)
print("Address: "+address)
print("Telephone number: "+telephone)
print("Cellphone: "+cellphone)
print("Birthday: "+birthday)
print("Civil Status: "+civil_status)
print("Place of Birth: "+birth_place)
print("Citizenship: "+citizenship)
print("Height: "+height)
print("Weight: "+weight)
print("Religion: "+religion)
print("Occupation: "+occupation)
print("Languages or dialect spoken or written: " +language)
print("")
print("EDUCATIONAL BACKGROUND")
print("")
print("Elementary: "+elementary)
print("Year graduated: "+elemgrad)
print("")
print("High School: "+high_school)
print("Year graduated: "+hsgrad)
print("")
print("College: "+college)
print("Year graduated: "+collegegrad)
print("Degree achieved: "+degree)
print("")
print("EMPLOYMENT RECORD")
print("")
print("Company: "+company)
print("Position: "+position)
print("From: "+companyfrom)
print("To: "+companyto)
print("")
print("CHARACTHER REFERENCE")
print("")
print("Name: "+charrefname)
print("Company: "+charcompany)
print("Position: "+charposition)
print("Number: "+charcontact)
You can create a variable using this format:
variable = action to run
You can use 'input' which asks the user a question
that will be stored and display upon calling. \033[0m
""")
def code_challenge2_help():
print("""
name = input("Enter your name: ")
print(f"\ t\ t * \ n\ t\ t * *\ n\ t\ t * * *\ n\ t * {name} *\ n \ t\ t * * *\ n \ t \ t * *\ n \ t\ t * ")
""")
def activity4_help():
print("""\033[1m
This program uses 'variable' with 'operators' to execute it's task
code:
number1 = eval(input("Please input a number-->"))
number2 = eval(input("Please input a number-->"))
answer = number1 + number2
print("The sum of" ,number1, "+" ,number2, "is",answer)
breakdown:
number1 and number2 = variables that will store the 2 numbers to be asked
answer = variable that will add the two numbers that were gathered with the 2 \033[0m
""")
def code_challenge5_help():
print("""\033[1m
This code converts Celcius to Farentheit
code:
print("")
print("FARENHEIT TO CELCIUS CONVERTER")
print("==============================")
farenheit = eval(input("Please input the temperature in farenheit-->"))
celcius = ((farenheit - 32) * 5 ) / 9 #formula
print(f"{farenheit} degrees farenheit converted to celcius is {round(celcius,2)} degrees")
breakdown:
farenheit - variable to get the temperature in farenheit
celcius - formula for converting farenheit into celcius \033[0m
""")
def act6_help():
print("""\033[1m
This program will store the first number then it will be added with next number
code:
x = 5
print("")
print(x)
x += 5
print(x)
x += 10
print(x)
x += 15
print(x)
x += 20
print(x)
x += 25
print(x)
x += 30
print(x)
x += 35
print(x)
x += 40
print(x)
x += 45
print(x)
x += 50
print(x)
x += 55
print(x)
breakdown:
x = 5 - first number
x += 5 - it is the same as x = x + 5
It will store the result and add it to the next number assigned \033[0m
""")
def code_challenge4_help():
print("""\033[1m
This program will ask for 2 numbers that will be used for different operations
code:
number1 = eval(input("Please input the first number -->"))
number2 = eval(input("Please input the second number -->"))
sum = number1 + number2
difference = number1 - number2
product = number1 * number2
qoutient = number1 / number2
exponent = number1 ** number2
remainder = number1 % number2
floor_division = number1 // number2
print("")
print("Result:")
print("")
print("The sum of",number1,"+",number2,"is = ",sum)
print("")
print("The difference of",number1,"and",number2,"is = ",difference)
print("")
print("The product of",number1,"and",number2,"is = ",product)
print("")
print("The qoutient of",number1,"and",number2,"is = ",qoutient)
print("")
print(number1,"exponent by",number2,"is = ",exponent)
print("")
print("The remainder of",number1,"and",number2,"is = ",remainder)
print("")
print("The floor division of",number1,"and",number2,"is = ",floor_division)
breakdown:
These two are assigned to get the number
number1 = eval(input("Please input the first number -->"))
number2 = eval(input("Please input the second number -->"))
It will then be used for these operations:
sum = number1 + number2
difference = number1 - number2
product = number1 * number2
qoutient = number1 / number2
exponent = number1 ** number2
remainder = number1 % number2
floor_division = number1 // number2 \033[0m
""")
def act7_help():
print(""" \033[1m
This program adds 1 count to gold if the mineral is gold
code:
gold = 0
miner = input("Please input your name: ")
isGold = input("Is the mineral gold? ")
if isGold.lower() == "yes":
gold +=1
print(f"Hi! {miner}, Your total number of gold is {gold}")
else:
print(f"Hi! {miner}, Your total number of gold is {gold}")
breakdown:
gold = 0 - variable for storing the number of gold,
so the first count will be 1
.lower() - converts all input into lowercase \033[0m
""")
def act8_help():
print(""" \033[1m
This program will let the user access the sytem if the password is correct
code:
password = input("Please input your password--->")
if password.lower() == "iloveyou123":
print("Access Granted, Please continue using the system.")
print(" -----System exit-----")
elif password.lower() == "Hello2024!":
print("Access Granted, Please continue using the system.")
print(" -----System exit-----")
elif password.lower() == "dll":
print("Access Granted, Please continue using the system.")
print(" -----System exit-----")
elif password.lower() == "password":
print("Access Granted, Please continue using the system.")
print(" -----System exit-----")
else:
print("Wrong password, Please try again.")
print(" -----System exit-----") \033[0m
""")
def act9_help():
print("""\033[1m
This program will evaluate your Age based on what you will input
code:
# act 9
# age category
age = eval(input("Please input your age: "))
if age <= 7:
print("=======")
print("Toddler")
if age >=8 and age <=13:
print("=======")
print("Pre teen")
if age >=14 and age <=18:
print("=======")
print("Teenager")
if age >=19 and age <=31:
print("=======")
print("Early adulthood")
if age >=32 and age <=45:
print("=======")
print("Mid adulthood")
if age >=46 and age <=59:
print("=======")
print("Post adulthood")
if age >=60:
print("=======")
print("Senior")
breakdown:
if - else - to sort the data that will be sent
if the condition is met, it will print the text within that condition
\033[0m""")
def act10_help():
print("""\033[1m
This program evaluates your Student Status
code:
name = input("Please input your name: ")
isStudent = input("Are your currently enrolled in DLL?: (yes / no): ")
if isStudent.lower() == "yes":
yearlevel = input("What year level are you in?\ n\ nF - Freshmen\ nS -
Sophomore\ nJ - Junior\ nR - Senior\ n\ nPlease input your answer: ")
if yearlevel.lower() == "f":
print(f"\nHi, {name}, Freshmen, Welcome to DLL")
if yearlevel.lower() == "s":
print(f"\nHi, {name}, Sophomore, Welcome back to DLL")
if yearlevel.lower() == "j":
print(f"\nHi, {name}, Junior, Welcome back to DLL")
if yearlevel.lower() == "r":
print(f"\nHi, {name}, Senior, Welcome back to DLL")
else:
print("\nThank you for using the system, you may now close it.\n")
\033[0m""")
def code_challenge6_help():
print("""\033[1m
This program computes your final grade
code:
print("\nFINAL GRADE COMPUTATION")
name = input("STUDENT'S FULL NAME: ")
prelim = eval(input("\nPlease input your prelim grade-->"))
midterm = eval(input("Please input your midterm grade-->"))
semifinal = eval(input("Please input your semifinal grade-->"))
final = eval(input("Please input your final grade-->"))
quiz = eval(input("Please input your quiz grade-->"))
project = eval(input("Please input your project grade-->"))
if (prelim >= 65 and prelim <=100) + (midterm >= 65 and midterm <=100) + (
semifinal >= 65 and semifinal <=100) + (final >= 65 and final <+100) +
(quiz >= 65 and quiz <=100) + (project >= 65 and project <=100):
final_grade = (prelim * 0.15) + (midterm * 0.15) + (semifinal * 0.15) + (final * 0.15) +
(quiz * 0.25) + (project * 0.15)
if final_grade >= 75:
print(f"\n{name}, your final grade is {round(final_grade,2)}")
print("Congratulations!, you passed!")
print("----SYSTEM EXIT----")
else:
print(f"\n{name}, your final grade is {round(final_grade,2)}")
prinint("----SYSTEM EXIT----")
else:
print("INVALID GRADE - Please try again")
\033[0m""")
def code_challenge7_help():
print("""\033[1m
This program helps you with your grocery
code:
#grocery
print("\nGROCERIES APP")
name = input("\nPLease input your name: ")
isGrocery = input("Did you buy a grocery? (yes / no): ")
if isGrocery.lower() == "yes":
itemname = input("Please input the item name: ")
price = int(input("Please input the price of the item: "))
amount = int(input("Please input your money: "))
age = eval(input("Please input your age: "))
if age <=59:
tax = price * 0.123
total = tax + price
change = amount - total
print(f"\nHi {name}, you purchased {itemname}, with a price of {price} plus 12.3% tax ({tax}) total of ({total})\nAmount given: {amount}\nChange:{round(change,2)}")
else:
taxs = price * 0.123
totals = price + taxs
discount = totals * 0.052
overall = totals - discount
changes = amount - overall
print(f"\nHi {name}, you purchased {itemname}, with a price of {price} plus 12.3% tax ({taxs}) total of ({totals}) with senior citizen discount of 5.2% ({discount}) with the overall total ({overall})\nAmount given: {amount}\nChange:{round(changes,2)}")
else:
print("Thank you, you may now close this app.")
\033[0m""")
def activity11_help():
print("""\033[1m
This program will loop a certain code for a given amount of iteration
code:
# loop
for lyrics in range(1,20):
# die with a smile
print("If the world was ending")
print("I wanna be next to you...")
isParty = False
print(f"if the party is {isParty}")
print("And our time on earth was through")
# opm
print("Saan ba to patungo...")
breakdown:
lyrics - name
range - in charge for the number of iteratios
range(1,20) - 1 is the starting point while 20 is the end point,
but take note that 20 will not be counted, it will stop at 19
\033[0m""")
def activity12_help():
print("""\033[1m
This program counts from 1 to 10
code:
for x in range(10, 0, -1):
print(x)
breakdown:
print(x) - x is will iterated
for x in range(10,0,-1) - x is the placeholder, 10 is the starting
point, 0 is the end point (it will stop at 1), while - 1 is the step
which means it will count backwards
\033[0m""")
def activity13_help():
print("""\033[1m
This program solves the factorial of a number for you
code:
num = eval(input(f"Enter a number: "))
factorial = 1
for x in range(num, 0, -1):
factorial *= x
print(f"The factorial of {num} is {factorial}")
breakdown:
num - variable to get the number
factorial = 1 - initial value for factorial
factorial *= x - factorial will be multiplied
to the value of x and will be stored for
the next operation
\033[0m""")
def activity14_help():
print("""\033[1m
This program will count to 10 with a line of *
code:
for x in range(0,11):
print(x, end =" ")
for y in range(0,11):
print("*", end =" ")
print()
\033[0m""")
def activity15_help():
print("""\033[1m
This program runs an acute triangle
code:
for x in range(0, 11,):
print(x, end =" ")
for y in range(0,x):
print("*", end =" ")
print()
\033[0m""")
def activity17_help():
print("""\033[1m
This program creates a multiplication table based on
the number of columns
code:
column = eval(input("Enter number of columns: "))
for x in range(1,11):
for y in range(1, column+1):
print(f"{x} x {y} = {x * y}", end="\t")
print()
\033[0m""")
def activity18_help():
print("""\033[1m
This program generates a number of triangle
based on the amount given
code:
nt = eval(input("Enter number of triangles: "))
for x in range(1,5):
for r in range(1, nt+1):
for y in range(1, x+1):
print("*", end=" ")
for z in range(5, x, -1):
print(" ", end=" ")
print(end=" ")
print()
\033[0m""")
def code_challenge8_help():
print("""\033[1m
This program asks for 10 numbers and will
display the summation of all numbers
code:
sum = 0
for x in range(1,11):
num = eval(input(f"Enter number {x}: "))
sum += num
print(f"The summation of all numbers are {sum}")
\033[0m""")
def code_challenge9_help():
print("""\033[1m
This program inversed version of acute triangle
code:
for x in range(0,11):
if x == 1:
print(" ", end=" ")
elif x == 2:
print(" ",end=" ")
elif x == 3:
print(" ",end=" ")
elif x == 4:
print(" ",end=" ")
elif x == 5:
print(" ",end=" ")
elif x == 6:
print(" ",end=" ")
elif x == 7:
print(" ",end=" ")
elif x == 8:
print(" ",end=" ")
elif x == 9:
print(" ",end=" ")
else:
print()
for y in range(10,x,-1):
print("*", end=" ")
print()
\033[0m""")
def code_challenge10_help():
print("""\033[1m
This program generates a diamond
code:
for x in range(6,1,-1):
for y in range(x,0,-1):
print(" ", end=" ")
for z in range(6,x,-1):
print("*", end=" ")
for a in range(6,x,-1):
print("*", end=" ")
print()
for x in range(1,6):
for y in range(1,x+1):
print(" ", end=" ")
for z in range(6,x,-1):
print("*", end=" ")
for a in range(6,x,-1):
print("*", end=" ")
print()
\033[0m""")
def code_challenge11_help():
print("""\033[1m
This program generates a perfect shape diamond
code:
for x in range(7,1,-1):
for y in range(x,0,-1):
print(" ", end=" ")
for z in range(6,x,-1):
print("*", end=" ")
for a in range(7,x,-1):
print("*", end=" ")
print()
for x in range(1,7):
for y in range(1,x+1):
print(" ", end=" ")
for z in range(6,x,-1):
print("*", end=" ")
for a in range(7,x,-1):
print("*", end=" ")
print()
\033[0m""")
def code_challenge12_help():
print("""\033[1m
This program creates an arrow sign
code:
for x in range(6,1,-1):
for y in range(x,0,-1):
print(" ",end=" ")
for z in range(6,x,-1):
print("*",end=" ")
for a in range(6,x,-1):
print("*",end=" ")
print()
for x in range(5,0,-1):
print(" ",end=" ")
for y in range(4,0,-1):
print(" ",end=" ")
for z in range(2,0,-1):
print("*",end=" ")
print()
\033[0m""")
def code_challenge13_help():
print("""\033[1m
This program creates diamond but using nummbers
code:
for x in range(1,6):
for y in range(6,x,-1):
print(" ", end=" ")
for z in range(x,1,-1):
print(z,end=" ")
for a in range(1,x+1):
print(a,end=" ")
print()
or x in range(4,0,-1):
for y in range(5+1,x,-1):
print(" ", end=" ")
for z in range(x,1,-1):
print(z,end=" ")
for a in range(1,x+1):
print(a,end=" ")
print()
\033[0m""")
def activity19_help():
print("""\033[1m
This program will continue to ask for name until the user
ends the program
code:
isContinue = True
while isContinue == True:
name = input("Give me a name ---> ")
if name.lower() == "stop":
print("Loop Terminated")
break
isContinue == False
else:
print(f"Hi, {name}")
continue
\033[0m""")
def activity20_help():
print("""\033[1m
Thisi program creates a triangle until
the user ends it
code:
isContinue = True
nt = 0
while isContinue == True:
ask = input("Gusto mo bang gumawa ng isa pang triangle (oo/hindi)")
if ask.lower() == "stop":
print("Program terminated")
break
isContinue == False
else:
nt += 1
for a in range(1,6):
for d in range(1,nt+1):
for b in range(1,a+1):
print("*",end=" ")
for c in range(6,a,-1):
print(" ",end=" ")
print(end=" ")
print()
continue
breakdown:
isContinue = True - variable in-charge for the
start and end of the loop
The loop will end if this variable
becomes False
\033[0m""")
def code_challenge14_help():
print("""\033[1m
This program will ask for a number and
will only stop if the user inputs 0
code:
# continue to ask user for a number
# summation at the end of loop
con = True
sum = 0
while con == True:
num = eval(input("Please enter a number --> (put 0 to stop) "))
if num > 0:
sum += num
continue
else:
print("\nLoop has stopped")
print(f"The summation of all the numbers you entered is {sum}")
break
con = False
\033[0m""")
def code_challenge15_help():
print("""\033[1m
This program creates triangle until the user
stops it
code:
import os
tuloy = True
no = 0
while tuloy:
ask = input("Do you wish to create a new triangle (yes/no) ")
if ask.lower() == "no":
print("program / loop terminated")
break
elif ask.lower() == "yes":
os.system("cls")
no += 1
for x in range(1,6):
for r in range(1, no+1):
for y in range(1,x+1):
print("^",end =" ")
for z in range(6,x,-1):
print(" ",end=" ")
print()
continue
else:
os.system("cls")
print("Invalid answer, please only answer 'yes' or ' no' ")
continue
breakdown:
import os - type of module
\033[0m""")
def activity25_help():
print("""\033[1m
This program creates a list of fruits
code:
# list
# fruit1 = "apples"
# fruit2 = "orange"
# fruit3 = "starapple"
# fruit4 = "bayabas"
# fruit5 = "durian"
# 0 1 2 3 4
fruits = ["apples","oranges","star-apple","guyabano","sour soup"]
# data inside a list is called 'item'
print(fruits)
#acccess indivually the item
print(f"My favorite fruit growing up is {fruits[2]}")
fruits.append("Longgan")
print(fruits)
fruits.insert(3,"banana")
print(fruits)
breakdown:
fruits - a list, the count will start at 0
fruits.append("") - will add an item at the
end of list
fruits.insert("") - will insert an item
at the designated location
\033[0m""")
def activity22_help():
print("""\033[1m
This program is a mini menu
code:
def panghello():
print("HELLO IT1A")
def activity2():
num1 = eval(input("Please enter a number: "))
num2 = eval(input("Please enter another number: "))
print(num1, "Floor divided to ",num2, "=",num1 // num2)
isContinue = True
while isContinue:
print("SELECT FROM THE FOLLOWING CODE \n1 = PANGHELLO
\n2 = DIVISION PROGRAM\n3 = EXIT")
ask = input("Which program would you like to run,
select from the option above: ")
if ask == "1":
panghello()
continue
elif ask == "2":
activity2()
elif ask == "3":
print("PROGRAM TERMINATED")
break
else:
print("Invalid Choice")
continue
\033[0m""")
def activity23_help():
print("""\033[1m
This program implements the help() code
def factorial(number):
This function's purpose is to compute / calculate the factorial of any number
fact = 1
for x in range(number,0,-1):
fact *= x
return fact
print(f"The factorial of 13 is {factorial(13)}")
help(factorial)
help(print)
\033[0m""")
def code_challenge16_help():
print("""\033[1m
This program is a mini bank program
code:
import os
balance = 0
access = False
transaction = True
def denomination():
one_th = balance // 1000
one_th_change = balance % 1000
print(f"1000 \t=\t {one_th}")
fiveh = one_th_change // 500
fiveh_change = one_th_change % 500
print(f"500 \t=\t {fiveh}")
twoh = fiveh_change // 200
twoh_change = fiveh_change % 200
print(f"200 \t=\t {twoh}")
oneh = twoh_change // 100
oneh_change = twoh_change % 100
print(f"100 \t=\t {oneh}")
fifty = oneh_change // 50
fify_change = oneh_change % 50
print(f"50 \t=\t {fifty}")
twenty = fify_change// 20
twenty_change = fify_change % 20
print(f"20 \t=\t {twenty}")
ten = twenty_change // 10
ten_change = twenty_change % 10
print(f"10 \t=\t {ten}")
five = ten_change // 5
five_change = ten_change % 5
print(f"5 \t=\t {five}")
one = five_change // 1
one_change = five_change % 1
print(f"1 \t=\t {one}")
def balance_inquiry():
print(f"\nYour balance across all account is ₱{balance}")
print("Here is the denomination: \n")
denomination()
def deposit():
amount = eval(input("Enter an amount to be deposited: "))
if amount < 0:
print("That's not a valid amount")
return 0
else:
print(f"You have successfully deposited an amount worth ₱{amount}, to see total balance and denomination, check balance inquiry.")
return amount
def withdraw():
amount = eval(input("Enter amount to be withdrawn: "))
if amount > balance:
print("Insufficient funds")
return 0
elif amount < 0:
print("Amount must be greater than 0")
return 0
else:
print(f"You have successfully withdrawn an amount worth ₱{amount}, to see total balance and denomination, check balance inquiry.")
return amount
def account():
create = input("Welcome to Bank A, Would you like to create an account? (yes / no) ")
if create.lower() == "yes":
bank_name = input("Enter your name: ")
print(f"Good to see you here {bank_name}!, You may now access the bank features")
else:
print("Thank you for visiting!")
access = False
def open_account():
another = input("Would you like to open another account? (yes / no) ")
if another == "yes":
name = input("Please enter the name of your account: ")
print(f"Good to see you here {name}!, You may now access the bank features")
else:
return
while transaction:
print("\n===== Welcome to Bank A! =====\n")
print("0.Create Account")
print("1.Open another account")
print("2.Show Balance")
print("3.Deposit")