Python Assignment for Ayesha
Python Assignment for Ayesha
Q2: Create program that takes the salary and designation of an employee as input
from the user
& then calculates net salary based on some simple rules such as deductions for
taxes
or other factors, depending on the designation.
Q3: Create a program that takes an integer input from the user & prints that number
of stars
on the console
1.name
2.salary
basic salary
and
tax deduction amount
and show in
f) table should be looks like this
Q5: Create the program use a lambda function to simulate the process where a
customer
orders a pizza, a waiter provides the pizza, and customer pays for it.
Use a lambda function to handle the payment and return the net result.
The program prompts the user to input the type of pizza and the price of the pizza.
Like
Bilal Hussain
Valid name
Bilal2023
Invalid name
Q8: Define a function which going to take argument a person height in inches and
also its name
and going to return it's height in feet.
E.g.When you run a function Program should ask following below questions
Prompt: Ayesha
Prompt: 65 inches
Show output:
Ayesha you are 5 feet 5 inches tall
Q9: Creating a simple Ludo dice roll program the logic is random number generation.
In Ludo, players roll a dice to determine their moves, and the dice generates a
number
between 1 and 6.
So write a Python program that simulates dice roll and displays a random number
2.The program asks user to press Enter to roll the dice, and then it displays the
result.
3. Play Again: After each roll, the program asks the user if they want to roll
again.
If the user types "y", the game continues; otherwise, it ends with a thank you
message.
Inputs "Name", "Std no.", like Name : Fahad Sohail - roll: B3456
- All the inputs should not me be empty
- the name should be string, not any other any other data type, roll no should
be number + strings
English - 77/100 =
Maths -
Science -
Social studies -
computer -
Urdu -
these subject sholud not be empty & only accepts integer or float
Ouput:
-************** MarkSheet -************
marks
Subjects Marks
English : 90
Urdu: 77
Example: result
Your total marks = 766
You got a 77.6566%
and have a Grade "A"