Fakultas Ilmu Komputer UI

Commit 076d3c4b authored by Ruly Achmad Gemilang Gultom's avatar Ruly Achmad Gemilang Gultom
Browse files

Tugas Pemograman 7 - Tahap 1 - 1906399915

parent 17105877
def minimal(angka):
f = open("input_order1.txt")
f1 = open("TP7_output1_1906399915.txt","w+")
filee = f.read()
sp = filee.split("\n")
for line in sp:
if int(line) >= int(angka):
s = print(int(line))
f1.write(str(s))
return s
filee.close()
minimal(400)
\ No newline at end of file
def elemen(data):
return data[1]
def tertinggi(tops):
tos = []
f = open("input_order2.txt")
fileso = open("TP7_output2_1906399915.txt","w+")
for line in f:
nama, angka = line.split(" ")
s = [nama, int(angka)]
tos.append(s)
tos.sort(key=elemen)
tos.reverse()
for line1 in tos[:tops]:
roro = print(str(line1[0])+" "+str(line1[1]))
riri = str(line1[0])+" "+str(line1[1])
fileso.write(str(riri))
f.close()
fileso.close()
return roro
print(tertinggi(5))
\ No newline at end of file
def
\ No newline at end of file
478
117
266
396
205
337
147
334
295
324
296
271
450
298
401
295
288
116
240
174
189
478
428
277
218
263
172
437
288
215
256
382
477
243
124
419
393
245
261
392
142
273
436
481
109
295
392
433
373
273
174
344
207
374
263
139
320
167
120
477
125
463
392
480
321
433
374
250
248
150
277
494
432
163
247
110
463
258
457
345
376
318
404
497
390
262
418
141
235
220
223
225
377
340
394
303
132
497
495
187
107
474
248
261
310
400
168
219
262
390
316
383
193
453
212
107
228
232
264
442
437
194
277
371
405
386
285
174
160
303
341
485
499
231
365
168
451
284
340
207
355
215
343
273
276
253
101
428
466
410
122
320
334
446
170
385
388
352
292
299
227
445
237
247
489
113
273
137
335
152
256
468
298
412
133
393
142
492
253
321
337
193
422
368
160
176
415
302
453
324
152
103
476
392
340
305
164
340
377
149
428
275
241
165
432
406
456
341
485
496
155
178
163
426
291
333
191
410
443
499
476
477
157
329
177
139
123
376
169
247
349
252
162
298
300
244
455
500
487
498
351
119
216
171
381
360
404
333
244
384
155
200
261
147
268
AIRAM 478
ALSI 117
ELLIS 266
RUBY 396
NIAMH 205
BRANDON 337
AIT 147
NYLEVE 334
MILLIE 295
NAES 324
ACUL 296
LOLA 271
EISOR 450
YRRAH 298
ZARA 401
NEDYAJ 295
LEBASI 288
FLORENCE 116
NOEL 240
ECARG 174
HAYDEN 189
MORGAN 478
IMOGEN 428
REBECCA 277
LYDIA 218
NIRE 263
MICHAEL 172
HARRIET 437
NAGROM 288
ACISSEJ 215
JAYDEN 256
SARAH 382
LOUIS 477
AARON 243
COURTNEY 124
ALICE 419
FINLEY 393
OSCAR 245
NEB 261
JAKE 392
ELEANOR 142
ELIZABETH 273
YLIL 436
YLLOH 481
NILTIAC 109
ALLE 295
MUHAMMAD 392
HTEBAZILE 433
AYAM 373
RACSO 273
NOSIDDAM 174
YLLIB 344
JESSICA 207
YBUR 374
ESME 263
FREDDIE 139
SOPHIE 320
OEL 167
AUHSOJ 120
YMA 477
RYAN 125
ACCEBER 463
POPPY 392
BETHANY 480
AIHPOS 321
EIMAJ 433
MARTHA 374
NEDYAH 250
CONNOR 248
GRACIE 150
EMILIA 277
HENRY 494
LUCAS 432
MATILDA 163
NOSIRRAH 247
KIAN 110
NAIK 463
LUKE 258
ALISHA 457
NEBUER 345
CAITLIN 376
YENTRUOC 318
LIBBY 404
EVA 497
MOLLY 390
FAITH 262
BLAKE 418
KAI 141
OLIVIA 235
WILLIAM 220
BENJAMIN 223
DRAWDE 225
AIVILO 377
HTIAF 340
BOCAJ 394
LEOJ 303
THOMAS 132
LAUREN 497
YPPOP 495
SILLE 187
MAX 107
ADLITAM 474
PHOEBE 248
BRADLEY 261
JOEL 310
MOHAMMAD 400
HOLLY 168
ROLYAT 219
YNAHTEB 262
RONNOC 390
LILLY 316
WEHTTAM 383
ARAZ 193
NAGOL 453
ROBERT 212
YRAHCAZ 107
AILUJ 228
ECILA 232
YBBIL 264
EOZ 442
YCUL 437
ZACHARY 194
GRACE 277
JASMINE 371
SEMAJ 405
TTELRACS 386
JACOB 285
NAREIK 174
EMSE 160
MADA 303
EILLE 341
CAASI 485
NAWE 499
EIDDERF 231
YALNIF 365
IXEL 168
FREYA 451
RILEY 284
DAMMAHOM 340
EIHPOS 207
SKYE 355
FRANCESCA 215
NAGEM 343
EKUL 273
EKALB 276
YLLIT 253
CHARLIE 101
LIAM 428
REBMA 466
EILRAHC 410
TOILLE 122
ALLEBASI 320
ECNEROLF 334
YLIME 446
JULIA 170
SIWEL 385
BEN 388
JOE 352
HPESOJ 292
DAISY 299
EDWARD 227
YELIR 445
EBEOHP 237
MAISIE 247
NOSAM 489
ALICIA 113
NAITSABES 273
EVIE 137
ISABEL 335
EIBBA 152
EKAJ 256
YECAL 468
SAM 298
LIAGIBA 412
MOHAMMED 133
HARVEY 393
TAYLOR 142
ISABELLA 492
ACSECNARF 253
JOHN 321
LILY 337
ZOE 193
OWEN 422
KAZ 368
XELA 160
BILLY 176
NODNARB 415
ALEX 302
NATHAN 453
EMILY 324
ADAM 152
NAVE 103
YELIAB 476
YBOT 392
JACK 340
TOBY 305
ELYK 164
YSIAD 340
ANNA 377
DANIEL 149
COREY 428
EYKS 275
TILLY 241
AMBER 165
LOGAN 432
NORAA 406
AMELIA 456
AIGROEG 341
SIENNA 485
HARRY 496
JAY 155
ARIEK 178
AHSILA 163
AMME 426
NIMAJNEB 291
SAMOHT 333
EGIAP 191
SACUL 410
YAJ 443
LEAH 499
ISOBEL 476
EITAK 477
TIA 157
NICOLE 329
YEROC 177
AHTRAM 139
EVE 123
REUBEN 376
MAYA 169
SYHR 247
SEBASTIAN 349
SUMMER 252
LEXIE 162
DYLAN 298
MULLAC 300
MARIA 244
EILLOH 455
EIFLA 500
CHARLOTTE 487
ELLIOT 498
DAVID 351
LEBOSI 119
ALEXANDRA 216
MAILLIW 171
NOTHSA 381
LUCA 360
REECE 404
CAMERON 333
NAHTE 244
NOSIDAM 384
ETHAN 155
EGROEG 200
LAYLA 261
JAMES 147
XAM 268
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment