🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Secure File Uploads: all 10 questions

Quiz: Secure File Uploads · Question 3 of 10

What does this print? (code)

What does this print?

name = "photo.jpg.php"
print(name.split(".")[1], name.rsplit(".", 1)[-1])
  1. A.php jpg
  2. B.jpg php
  3. C.photo php
  4. D.jpg jpg
Answer & explanation

Correct answer: jpg php

A check that reads the first extension sees jpg; the server decides by the last one, php.

Can you get the rest right without peeking?

Take the timed Quiz: Secure File Uploads quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →