#--------☆ Practise Set 1 Started ☆------------
Q.1 Write a Programme to Print the Poem or Lyrics of Twinkle Twinkle Song
print('''Twinkle, twinkle, little star,
How I wonder what you are!
Up above the world so high,
Like a diamond in the sky.
Twinkle, twinkle, little star,
How I wonder what you are!''')
- This Is how you can write a new line using a python, use a '''(Triple single quotation marks) due to this what you have written in any manner it will execute.
- If you use double or single quotation mark then it will not print it will give a error as "Error while scanning the string literal"
- The single and double quotation marks are made for single line only
<hr>
Q.2 Print table of 5 using REPL
- Using the terminal/interpreter you can do it.
- You must start with writing a "Python" so it will understand you are writing/excuting a python codes from here
Q.3 Write a code to import a modules and run a code
'''
pip install <playsound>
------
import <playsound>
playsound('D://mydata//newfolder//songs//song.mp3')
☆ Here we used the // because a single slash and character coinside then different sequences are made.
#Q 4: Write A python program to print the directories in your programs using os module by searching on web.
'''
import os
print(os.listdir()) #List of files or directories
print(os.getcwd()) # Curent working directories
#OR
import os
files = os.listdir()
print(files) #print(files[0])
#Q 5: For The Question 4 write A author,name (labels) using comments
#author : Aditya Vaste
#written by : Aditya
import os
print(os.listdir()[0]) #1st element of array
#--------☆ Practise Set 1 Completed ☆----------
Post a Comment