Python Libraries
✕random
Question 1 of 4
- Create a guessing game. Computer has to randomly select a number between 1 to 10 and then ask user to guess it. If user guesses correctly display
Congratulations!! You Winelse display,You Loose. Number was {num}. - Modify this game so that user has three attempt to guess. For incorrect guess, display
Incorrect!! Guess higher/lower numberdepending upon if number guessed by user is lower or higher. If user can't guess in 3 attempt displayYou Loose. Number was {num}. - Create a Rock, Scissor, Paper game. Computer chooses one randomly & ask user for input. Display
You Win/Loosedepending on game logic. [Ask user if he wants to replay] - Create a Hangman game. Ask user for level:
Easy,DifficultandHard. Words for game has to be taken from json file that has words separated on the basis of level. If user is able to guess word in 5 attempt displayYou WinelseYou Loose, Word was {word}. [Note: 1st & last letter has to be pre-filled and there should be short description as hint for each word].
- Create a guessing game. Computer has to randomly select a number between 1 to 10 and then ask user to guess it. If user guesses correctly display
mailerpy, os
Question 2 of 4
- Write a function
shuffle_for_flash_gamethat takesnum_of_playeras input and return shuffled cards in form[{"p1": [c_1, c_2, c_3]}, …. {"pn": [c4, c5, c6]}] - Marketing team has a csv of user eligible in lucky draw. It has headers
Name,Number,Email,Address. You need to create program that randomly selects three luck winner & send mail to them as:Congratulation!! {Name}. You won.[Create csv file yourself] - Create a folder
all_doc. Inside it create multiple python and doc files manually. Write a program that separates python and doc files into two different folderpython_filesanddoc_filesrespectively. At end display number of files moved to each folder. - Create a program that counts and dispays number of exercises done in each course module. Show output as:
[{Module: Basics, Exercise: 10, Lines of Code: 100}, {..}]
- Write a function
math, datetime
Question 3 of 4
- Find HCF and LCM of list of numbers using math library.
- Calculate factorial of a number using math library.
- Assign
x_degree = [0, 45, 90, 180]and calculatesin(x),cos(x)andtan(x). - Calculate and display day of the week he/she was born on. (SUN, MON ..)
- Calculate and display his/her current age in years, months and days.
- Calculate and display number of days until next birthday.
- Create a program that takes two dates as input and calculates difference between them in terms of years.
Ask user for his/her date of birth:data related
Question 4 of 4
- Scrape share data from website and store in csv. Name of csv has to be date of data. E.g.
2026-04-01.csv. Email scrapped csv file to[email protected]with subjectShare Data for {date}and bodydata scrapped from {url}. Keep yourself in cc - Load above data as pandas datframe. Filter company that has LTP betwen 500 - 5000.
- Load scrapped data and plot scatter plot of LTP and Volume
- Scrape share data from website and store in csv. Name of csv has to be date of data. E.g.
