-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
5028 lines (4146 loc) · 229 KB
/
app.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
import gradio as gr
def display_answer(answer):
return answer
with gr.Blocks() as demo:
gr.Markdown("# 1000 Flashcards ( General, Sports, Technical,Space ) ")
gr.Markdown("---")
with gr.Row():
gr.Markdown("**What is the capital of France?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Paris."), outputs=txt)
with gr.Row():
gr.Markdown("**True or False: The human heart has three chambers.**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("False, the human heart has four chambers."), outputs=txt)
with gr.Row():
gr.Markdown("**What is the largest ocean on Earth?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("The Pacific Ocean."), outputs=txt)
with gr.Row():
gr.Markdown("**Who painted the Mona Lisa?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Leonardo da Vinci."), outputs=txt)
with gr.Row():
gr.Markdown("**What is the capital of Japan?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Tokyo."), outputs=txt)
with gr.Row():
gr.Markdown("**True or False: The Great Wall of China is visible from space.**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("False, it's a myth that the Great Wall of China is visible from space."), outputs=txt)
with gr.Row():
gr.Markdown("**What is the chemical symbol for gold?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Au."), outputs=txt)
with gr.Row():
gr.Markdown("**Who wrote '1984'?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("George Orwell."), outputs=txt)
with gr.Row():
gr.Markdown("**What is the smallest planet in our Solar System?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Mercury."), outputs=txt)
with gr.Row():
gr.Markdown("**True or False: Bananas grow on trees.**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("False, bananas grow on large herbaceous plants."), outputs=txt)
with gr.Row():
gr.Markdown("**What is the capital of Canada?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Ottawa."), outputs=txt)
with gr.Row():
gr.Markdown("**Who discovered penicillin?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Alexander Fleming."), outputs=txt)
with gr.Row():
gr.Markdown("**What is the tallest mountain in the world?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Mount Everest."), outputs=txt)
with gr.Row():
gr.Markdown("**True or False: Dolphins are fish.**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("False, dolphins are mammals."), outputs=txt)
with gr.Row():
gr.Markdown("**What is the largest desert in the world?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("The Sahara Desert."), outputs=txt)
with gr.Row():
gr.Markdown("**Who wrote 'To Kill a Mockingbird'?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Harper Lee."), outputs=txt)
with gr.Row():
gr.Markdown("**What is the hardest natural substance on Earth?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Diamond."), outputs=txt)
with gr.Row():
gr.Markdown("**True or False: Humans have more than 5 senses.**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("True, humans have more than 5 senses."), outputs=txt)
with gr.Row():
gr.Markdown("**What is the largest planet in our Solar System?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Jupiter."), outputs=txt)
with gr.Row():
gr.Markdown("**Who wrote 'The Odyssey'?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Homer."), outputs=txt)
with gr.Row():
gr.Markdown("**What is the chemical symbol for water?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("H2O."), outputs=txt)
with gr.Row():
gr.Markdown("**True or False: The Sun is a star.**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("True, the Sun is a star."), outputs=txt)
with gr.Row():
gr.Markdown("**What is the capital of Italy?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Rome."), outputs=txt)
with gr.Row():
gr.Markdown("**Who painted 'The Starry Night'?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Vincent van Gogh."), outputs=txt)
with gr.Row():
gr.Markdown("**What is the most abundant gas in the Earth's atmosphere?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Nitrogen."), outputs=txt)
with gr.Row():
gr.Markdown("**True or False: The Amazon is the longest river in the world.**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("False, the Nile is the longest river in the world."), outputs=txt)
with gr.Row():
gr.Markdown("**What is the capital of Russia?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Moscow."), outputs=txt)
with gr.Row():
gr.Markdown("**Who invented the telephone?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Alexander Graham Bell."), outputs=txt)
with gr.Row():
gr.Markdown("**What is the largest mammal in the world?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("The blue whale."), outputs=txt)
with gr.Row():
gr.Markdown("**True or False: Light travels faster than sound.**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("True, light travels faster than sound."), outputs=txt)
with gr.Row():
gr.Markdown("**What is the capital of Germany?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Berlin."), outputs=txt)
with gr.Row():
gr.Markdown("**Who wrote 'Pride and Prejudice'?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Jane Austen."), outputs=txt)
with gr.Row():
gr.Markdown("**What is the currency of the United Kingdom?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Pound Sterling."), outputs=txt)
with gr.Row():
gr.Markdown("**True or False: An octopus has three hearts.**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("True, an octopus has three hearts."), outputs=txt)
with gr.Row():
gr.Markdown("**What is the capital of India?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("New Delhi."), outputs=txt)
with gr.Row():
gr.Markdown("**What is the capital of Australia?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Canberra."), outputs=txt)
with gr.Row():
gr.Markdown("**True or False: The Atlantic Ocean is the largest ocean on Earth.**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("False, the Pacific Ocean is the largest."), outputs=txt)
with gr.Row():
gr.Markdown("**Who is the author of 'Harry Potter'?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("J.K. Rowling."), outputs=txt)
with gr.Row():
gr.Markdown("**What is the chemical symbol for iron?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Fe."), outputs=txt)
with gr.Row():
gr.Markdown("**True or False: The human body has four lungs.**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("False, the human body has two lungs."), outputs=txt)
with gr.Row():
gr.Markdown("**What is the capital of Brazil?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Brasilia."), outputs=txt)
with gr.Row():
gr.Markdown("**Who painted 'The Last Supper'?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Leonardo da Vinci."), outputs=txt)
with gr.Row():
gr.Markdown("**What is the speed of light?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Approximately 299,792 kilometers per second (186,282 miles per second)."), outputs=txt)
with gr.Row():
gr.Markdown("**True or False: The Great Wall of China is the only man-made structure visible from space.**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("False, there are other man-made structures visible from space."), outputs=txt)
with gr.Row():
gr.Markdown("**What is the capital of Egypt?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Cairo."), outputs=txt)
with gr.Row():
gr.Markdown("**Who is the author of 'Pride and Prejudice'?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Jane Austen."), outputs=txt)
with gr.Row():
gr.Markdown("**What is the largest continent on Earth?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Asia."), outputs=txt)
with gr.Row():
gr.Markdown("**True or False: Humans share 50% of their DNA with bananas.**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("True, humans share approximately 50% of their DNA with bananas."), outputs=txt)
with gr.Row():
gr.Markdown("**What is the capital of Argentina?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Buenos Aires."), outputs=txt)
with gr.Row():
gr.Markdown("**Who is the author of 'The Great Gatsby'?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("F. Scott Fitzgerald."), outputs=txt)
with gr.Row():
gr.Markdown("**What is the smallest bone in the human body?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("The stapes (or stirrup) bone in the middle ear."), outputs=txt)
with gr.Row():
gr.Markdown("**True or False: The Eiffel Tower is taller than the Statue of Liberty.**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("True, the Eiffel Tower is taller than the Statue of Liberty."), outputs=txt)
with gr.Row():
gr.Markdown("**What is the capital of Spain?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Madrid."), outputs=txt)
with gr.Row():
gr.Markdown("**Who developed the theory of relativity?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Albert Einstein."), outputs=txt)
with gr.Row():
gr.Markdown("**What is the longest river in the world?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("The Nile River."), outputs=txt)
with gr.Row():
gr.Markdown("**True or False: The Great Pyramid of Giza is one of the Seven Wonders of the Ancient World.**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("True, the Great Pyramid of Giza is one of the Seven Wonders of the Ancient World."), outputs=txt)
with gr.Row():
gr.Markdown("**What is the capital of Mexico?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Mexico City."), outputs=txt)
with gr.Row():
gr.Markdown("**Who wrote 'Romeo and Juliet'?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("William Shakespeare."), outputs=txt)
with gr.Row():
gr.Markdown("**What is the hardest natural substance?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Diamond."), outputs=txt)
with gr.Row():
gr.Markdown("**True or False: The capital of Australia is Sydney.**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("False, the capital of Australia is Canberra."), outputs=txt)
with gr.Row():
gr.Markdown("**What is the capital of China?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Beijing."), outputs=txt)
with gr.Row():
gr.Markdown("**Who discovered gravity?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Sir Isaac Newton."), outputs=txt)
with gr.Row():
gr.Markdown("**What is the largest organ in the human body?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("The skin."), outputs=txt)
with gr.Row():
gr.Markdown("**True or False: Sharks are mammals.**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("False, sharks are fish."), outputs=txt)
with gr.Row():
gr.Markdown("**What is the capital of South Africa?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Pretoria (administrative), Bloemfontein (judicial), and Cape Town (legislative)."), outputs=txt)
with gr.Row():
gr.Markdown("**Who wrote 'The Catcher in the Rye'?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("J.D. Salinger."), outputs=txt)
with gr.Row():
gr.Markdown("**What is the most spoken language in the world?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Mandarin Chinese."), outputs=txt)
with gr.Row():
gr.Markdown("**True or False: The human skeleton is made up of over 300 bones.**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("False, an adult human skeleton has 206 bones."), outputs=txt)
with gr.Row():
gr.Markdown("**What is the capital of Greece?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Athens."), outputs=txt)
with gr.Row():
gr.Markdown("**What is the capital of Greece?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Athens."), outputs=txt)
with gr.Row():
gr.Markdown("**Who painted 'The Scream'?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Edvard Munch."), outputs=txt)
with gr.Row():
gr.Markdown("**What is the largest planet in our solar system?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Jupiter."), outputs=txt)
with gr.Row():
gr.Markdown("**True or False: A leap year has 365 days.**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("False, a leap year has 366 days."), outputs=txt)
with gr.Row():
gr.Markdown("**What is the capital of Canada?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Ottawa."), outputs=txt)
with gr.Row():
gr.Markdown("**Who developed the theory of general relativity?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Albert Einstein."), outputs=txt)
with gr.Row():
gr.Markdown("**What is the smallest country in the world by area?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Vatican City."), outputs=txt)
with gr.Row():
gr.Markdown("**True or False: Humans have 46 chromosomes.**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("True, humans have 46 chromosomes."), outputs=txt)
with gr.Row():
gr.Markdown("**What is the capital of Italy?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Rome."), outputs=txt)
with gr.Row():
gr.Markdown("**Who painted 'The Persistence of Memory'?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Salvador Dalí."), outputs=txt)
with gr.Row():
gr.Markdown("**What is the longest river in Africa?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("The Nile River."), outputs=txt)
with gr.Row():
gr.Markdown("**True or False: The Earth is the fourth planet from the Sun.**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("False, the Earth is the third planet from the Sun."), outputs=txt)
with gr.Row():
gr.Markdown("**What is the capital of Japan?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Tokyo."), outputs=txt)
with gr.Row():
gr.Markdown("**Who wrote 'Moby-Dick'?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Herman Melville."), outputs=txt)
with gr.Row():
gr.Markdown("**What is the largest island in the world?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Greenland."), outputs=txt)
with gr.Row():
gr.Markdown("**True or False: Venus is the hottest planet in our solar system.**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("True, Venus is the hottest planet in our solar system."), outputs=txt)
with gr.Row():
gr.Markdown("**What is the capital of Russia?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Moscow."), outputs=txt)
with gr.Row():
gr.Markdown("**Who developed the laws of motion?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Isaac Newton."), outputs=txt)
with gr.Row():
gr.Markdown("**What is the longest bone in the human body?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("The femur."), outputs=txt)
with gr.Row():
gr.Markdown("**True or False: The Great Wall of China is more than 10,000 kilometers long.**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("True, the Great Wall of China is more than 10,000 kilometers long."), outputs=txt)
with gr.Row():
gr.Markdown("**What is the capital of the United States?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Washington, D.C."), outputs=txt)
with gr.Row():
gr.Markdown("**Who wrote 'The Adventures of Huckleberry Finn'?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Mark Twain."), outputs=txt)
with gr.Row():
gr.Markdown("**What is the largest ocean on Earth?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("The Pacific Ocean."), outputs=txt)
with gr.Row():
gr.Markdown("**True or False: Mars is known as the Red Planet.**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("True, Mars is known as the Red Planet."), outputs=txt)
with gr.Row():
gr.Markdown("**What is the capital of India?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("New Delhi."), outputs=txt)
with gr.Row():
gr.Markdown("**Who painted the ceiling of the Sistine Chapel?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Michelangelo."), outputs=txt)
with gr.Row():
gr.Markdown("**What is the chemical symbol for gold?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Au."), outputs=txt)
with gr.Row():
gr.Markdown("**True or False: The Sahara is the largest desert in the world.**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("True, the Sahara is the largest hot desert in the world."), outputs=txt)
with gr.Row():
gr.Markdown("**What is the capital of Australia?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Canberra."), outputs=txt)
with gr.Row():
gr.Markdown("**Who wrote 'The Odyssey'?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Homer."), outputs=txt)
with gr.Row():
gr.Markdown("**What is the smallest planet in our solar system?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Mercury."), outputs=txt)
with gr.Row():
gr.Markdown("**True or False: There are 50 states in the USA.**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("True, there are 50 states in the USA."), outputs=txt)
with gr.Row():
gr.Markdown("**What is the capital of Brazil?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Brasilia."), outputs=txt)
with gr.Row():
gr.Markdown("**Who wrote 'Don Quixote'?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Miguel de Cervantes."), outputs=txt)
with gr.Row():
gr.Markdown("**What is the largest animal on Earth?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("The blue whale."), outputs=txt)
with gr.Row():
gr.Markdown("**What does HTTP stand for?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("HyperText Transfer Protocol."), outputs=txt)
with gr.Row():
gr.Markdown("**What is the time complexity of binary search?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("O(log n)."), outputs=txt)
with gr.Row():
gr.Markdown("**True or False: Python is a statically typed language.**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("False, Python is a dynamically typed language."), outputs=txt)
with gr.Row():
gr.Markdown("**What does SQL stand for?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Structured Query Language."), outputs=txt)
with gr.Row():
gr.Markdown("**Who is known as the father of computer science?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Alan Turing."), outputs=txt)
with gr.Row():
gr.Markdown("**What is the purpose of the 'git clone' command?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("To create a copy of an existing Git repository."), outputs=txt)
with gr.Row():
gr.Markdown("**True or False: An IP address uniquely identifies a device on a network.**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("True, an IP address uniquely identifies a device on a network."), outputs=txt)
with gr.Row():
gr.Markdown("**What does CSS stand for in web development?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Cascading Style Sheets."), outputs=txt)
with gr.Row():
gr.Markdown("**What is the time complexity of bubble sort?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("O(n^2)."), outputs=txt)
with gr.Row():
gr.Markdown("**What is the function of DNS in networking?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("To translate domain names to IP addresses."), outputs=txt)
with gr.Row():
gr.Markdown("**True or False: JSON stands for JavaScript Oriented Notation.**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("False, JSON stands for JavaScript Object Notation."), outputs=txt)
with gr.Row():
gr.Markdown("**What is the main purpose of a firewall in network security?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("To monitor and control incoming and outgoing network traffic based on security rules."), outputs=txt)
with gr.Row():
gr.Markdown("**What does RAM stand for in computing?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Random Access Memory."), outputs=txt)
with gr.Row():
gr.Markdown("**True or False: TCP/IP is a protocol suite used for communication over the internet.**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("True, TCP/IP is a protocol suite used for communication over the internet."), outputs=txt)
with gr.Row():
gr.Markdown("**What is the primary function of an operating system?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("To manage the computer's hardware and software resources and provide common services for computer programs."), outputs=txt)
with gr.Row():
gr.Markdown("**What does GPU stand for in computer hardware?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Graphics Processing Unit."), outputs=txt)
with gr.Row():
gr.Markdown("**True or False: The OSI model has 7 layers.**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("True, the OSI model has 7 layers."), outputs=txt)
with gr.Row():
gr.Markdown("**What is the command to list all files and directories in Linux?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("ls"), outputs=txt)
with gr.Row():
gr.Markdown("**What is the full form of HTML?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("HyperText Markup Language."), outputs=txt)
with gr.Row():
gr.Markdown("**True or False: IPv6 uses 128-bit addresses.**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("True, IPv6 uses 128-bit addresses."), outputs=txt)
with gr.Row():
gr.Markdown("**What is the difference between '=='' and '===' in JavaScript?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("'==' checks for equality of value, while '===' checks for equality of value and type."), outputs=txt)
with gr.Row():
gr.Markdown("**What does 'API' stand for in software development?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Application Programming Interface."), outputs=txt)
with gr.Row():
gr.Markdown("**True or False: A linked list is a linear data structure.**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("True, a linked list is a linear data structure."), outputs=txt)
with gr.Row():
gr.Markdown("**What is the primary use of a database index?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("To improve the speed of data retrieval operations."), outputs=txt)
with gr.Row():
gr.Markdown("**What does 'JSON' stand for?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("JavaScript Object Notation."), outputs=txt)
with gr.Row():
gr.Markdown("**True or False: REST stands for Representational State Transfer.**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("True, REST stands for Representational State Transfer."), outputs=txt)
with gr.Row():
gr.Markdown("**What is the purpose of the 'mv' command in Linux?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("To move or rename files and directories."), outputs=txt)
with gr.Row():
gr.Markdown("**What does DNS stand for?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Domain Name System."), outputs=txt)
with gr.Row():
gr.Markdown("**True or False: Docker is a tool used for virtualization.**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("True, Docker is a tool used for containerization, which is a form of virtualization."), outputs=txt)
#neww
with gr.Row():
gr.Markdown("**What will be the output of the following code snippet?**\n\n```python\nx = 5\ny = 2\nprint(x / y)\n```")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("2.5"), outputs=txt)
with gr.Row():
gr.Markdown("**What will be the output of the following code snippet?**\n\n```python\nx = 10\ny = 3\nprint(x // y)\n```")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("3"), outputs=txt)
with gr.Row():
gr.Markdown("**What is the value of `a` after executing the following code snippet?**\n\n```python\na = 5\na += 3\n```")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("8"), outputs=txt)
with gr.Row():
gr.Markdown("**What will be the output of the following code snippet?**\n\n```python\nx = True\ny = False\nprint(x and y)\n```")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("False"), outputs=txt)
with gr.Row():
gr.Markdown("**What will be the output of the following code snippet?**\n\n```python\nx = True\ny = False\nprint(x or y)\n```")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("True"), outputs=txt)
with gr.Row():
gr.Markdown("**What will be the output of the following code snippet?**\n\n```python\nx = True\nprint(not x)\n```")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("False"), outputs=txt)
with gr.Row():
gr.Markdown("**What will be the output of the following code snippet?**\n\n```python\nx = 10\ny = 5\nprint(x == y)\n```")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("False"), outputs=txt)
with gr.Row():
gr.Markdown("**What will be the output of the following code snippet?**\n\n```python\nx = 10\ny = 10\nprint(x != y)\n```")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("False"), outputs=txt)
with gr.Row():
gr.Markdown("**What will be the output of the following code snippet?**\n\n```python\nx = 10\ny = 5\nprint(x > y)\n```")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("True"), outputs=txt)
with gr.Row():
gr.Markdown("**What will be the output of the following code snippet?**\n\n```python\nx = 10\ny = 5\nprint(x < y)\n```")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("False"), outputs=txt)
with gr.Row():
gr.Markdown("**What will be the output of the following code snippet?**\n\n```python\nx = 10\ny = 10\nprint(x >= y)\n```")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("True"), outputs=txt)
with gr.Row():
gr.Markdown("**What will be the output of the following code snippet?**\n\n```python\nx = 5\ny = 5\nprint(x <= y)\n```")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("True"), outputs=txt)
with gr.Row():
gr.Markdown("**What will be the output of the following code snippet?**\n\n```python\nx = 2\ny = 5\nif x > y:\n print('x is greater than y')\nelse:\n print('y is greater than x')\n```")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("y is greater than x"), outputs=txt)
with gr.Row():
gr.Markdown("**What will be the output of the following code snippet?**\n\n```python\nx = 5\ny = 5\nif x == y:\n print('x is equal to y')\nelse:\n print('x is not equal to y')\n```")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("x is equal to y"), outputs=txt)
with gr.Row():
gr.Markdown("**What will be the output of the following code snippet?**\n\n```python\nx = 7\ny = 10\nif x > y:\n print('x is greater than y')\nelif x < y:\n print('x is less than y')\nelse:\n print('x is equal to y')\n```")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("x is less than y"), outputs=txt)
with gr.Row():
gr.Markdown("**What will be the output of the following code snippet?**\n\n```python\nx = 10\ny = 10\nif x != y:\n print('x is not equal to y')\nelse:\n print('x is equal to y')\n```")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("x is equal to y"), outputs=txt)
#newscience
with gr.Row():
gr.Markdown("**What is the chemical symbol for water?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("H2O"), outputs=txt)
with gr.Row():
gr.Markdown("**What is the chemical symbol for oxygen?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("O"), outputs=txt)
with gr.Row():
gr.Markdown("**What is the chemical symbol for carbon?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("C"), outputs=txt)
with gr.Row():
gr.Markdown("**What is the chemical symbol for sodium?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Na"), outputs=txt)
with gr.Row():
gr.Markdown("**What is the chemical symbol for potassium?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("K"), outputs=txt)
with gr.Row():
gr.Markdown("**What is the chemical symbol for gold?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Au"), outputs=txt)
with gr.Row():
gr.Markdown("**What is the chemical symbol for silver?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Ag"), outputs=txt)
with gr.Row():
gr.Markdown("**What is the chemical symbol for iron?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Fe"), outputs=txt)
with gr.Row():
gr.Markdown("**What is the chemical symbol for copper?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Cu"), outputs=txt)
with gr.Row():
gr.Markdown("**What is the chemical symbol for helium?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("He"), outputs=txt)
with gr.Row():
gr.Markdown("**What is the chemical symbol for nitrogen?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("N"), outputs=txt)
with gr.Row():
gr.Markdown("**What is the chemical symbol for phosphorus?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("P"), outputs=txt)
with gr.Row():
gr.Markdown("**What is the chemical symbol for sulfur?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("S"), outputs=txt)
with gr.Row():
gr.Markdown("**What is the chemical symbol for calcium?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()
btn.click(fn=lambda: display_answer("Ca"), outputs=txt)
with gr.Row():
gr.Markdown("**What is the chemical symbol for magnesium?**")
btn = gr.Button("Show Answer")
txt = gr.Textbox()