Computer Science, asked by amirthavarshini25200, 3 months ago

10. Given a file object "cs" write python statement to print/display
the name of the file.​

Answers

Answered by Anonymous
0

Explanation:

Pʜᴏᴛᴏsʏɴᴛʜᴇsɪs, ᴛʜᴇ ᴘʀᴏᴄᴇss ʙʏ ᴡʜɪᴄʜ ɢʀᴇᴇɴ ᴘʟᴀɴᴛs ᴀɴᴅ ᴄᴇʀᴛᴀɪɴ ᴏᴛʜᴇʀ ᴏʀɢᴀɴɪsᴍs ᴛʀᴀɴsғᴏʀᴍ ʟɪɢʜᴛ ᴇɴᴇʀɢʏ ɪɴᴛᴏ ᴄʜᴇᴍɪᴄᴀʟ ᴇɴᴇʀɢʏ. Dᴜʀɪɴɢ ᴘʜᴏᴛᴏsʏɴᴛʜᴇsɪs ɪɴ ɢʀᴇᴇɴ ᴘʟᴀɴᴛs, ʟɪɢʜᴛ ᴇɴᴇʀɢʏ ɪs ᴄᴀᴘᴛᴜʀᴇᴅ ᴀɴᴅ ᴜsᴇᴅ ᴛᴏ ᴄᴏɴᴠᴇʀᴛ ᴡᴀᴛᴇʀ, ᴄᴀʀʙᴏɴ ᴅɪᴏxɪᴅᴇ, ᴀɴᴅ ᴍɪɴᴇʀᴀʟs ɪɴᴛᴏ ᴏxʏɢᴇɴ ᴀɴᴅ ᴇɴᴇʀɢʏ-ʀɪᴄʜ ᴏʀɢᴀɴɪᴄ ᴄᴏᴍᴘᴏᴜɴᴅs.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

....

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

....

.

.

.

.

.

..

.

.

..

.

..

.

.

.

.

.

.

.

.

.

.

.

....

.

.

...

.

.

.

..

.

..

.

.

Answered by jai696
1

\huge\red{\mid{\fbox{\tt{Using\: Python\: 3}}\mid}}

import os

cs = open("some_file")

base = os.path.basename(cs.name)

print(f"name: {os.path.splitext(base)[0]}")

\large\mathsf\color{lightgreen}useful?\: \color{white}\longrightarrow\: \color{orange}brainliest!

Similar questions
Math, 1 month ago