Assignment 1
Python Basics & Arithmetic Operators
This assignment covers:
• Variables
• Input Output
• Type Conversion
• Arithmetic Operators
Write all programs in Python and try to dry run each program before executing.
Q1. Write a program to print your name, age, and city.
Q2. Take your name as input and print a welcome message.
Q3. Take two numbers as input and print their sum.
Q4. Take two numbers and print subtraction result.
Q5. Take two numbers and print multiplication result.
Q6. Take two numbers and print division result.
Q7. Write a program to find the square of a number.
Q8. Write a program to find the cube of a number.
Q9. Write a program to calculate the area of a rectangle.
Q10. Write a program to calculate the perimeter of a rectangle.
Q11. Take radius as input and find area of a circle.
Q12. Take temperature in Celsius and convert it to Fahrenheit.
Q13. Take marks of 3 subjects and calculate average marks.
Q14. Write a program to calculate simple interest.
Q15. Write a program to swap two numbers using a third variable.
Q16. Write a program to find remainder when one number is divided by another.
Q17. Take number of days as input and convert it into years and remaining days.
Q18. Take a 3-digit number and print the last digit using modulus operator.
Q19. Write a program to calculate electricity bill for units consumed:
Bill = units × 5
Q20. Take length and breadth from user and check area using multiplication operator.
Q21. Take a number and print its half using division operator.
Q22. Take a number and print double and triple of the number.
Q23. Take total marks and obtained marks and calculate percentage.
Q24. Write a program to calculate total salary if:
salary = basic + bonus
Q25. Take 2 numbers and print all arithmetic operations together.
Important Tips
• Use meaningful variable names.
• Practice dry run for every program.
• Use int(input()) wherever needed.
• Focus on logic building rather than memorizing.
• Try changing values and observe outputs.
Prepared for Python Beginners Practice