0% found this document useful (0 votes)
6 views2 pages

Python 50 Assignment Operator Programs

The document outlines 50 programming exercises focused on Python's assignment operators. Each exercise demonstrates various ways to use operators like '+=', '-=', '*=', '/=', and others with different data types and scenarios. The exercises include tasks such as arithmetic operations, string manipulation, list indexing, and practical applications like a calculator and inventory tracking.

Uploaded by

ayushshinde450
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views2 pages

Python 50 Assignment Operator Programs

The document outlines 50 programming exercises focused on Python's assignment operators. Each exercise demonstrates various ways to use operators like '+=', '-=', '*=', '/=', and others with different data types and scenarios. The exercises include tasks such as arithmetic operations, string manipulation, list indexing, and practical applications like a calculator and inventory tracking.

Uploaded by

ayushshinde450
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Python 50 Programs - Assignment Operators

1. Assign a number to a variable and print it.

2. Assign the result of an arithmetic expression to a variable.

3. Assign string to a variable and print it.

4. Assign a list to a variable and access its elements.

5. Assign values to multiple variables in one line.

6. Add 5 to a variable using '+='.

7. Use '+=' inside a loop to calculate sum of first 10 natural numbers.

8. Concatenate strings using '+='.

9. Use '+=' with a float value.

10. Use '+=' to update list index value.

11. Subtract 3 from a variable using '-='.

12. Use '-=' inside a loop to count down from 10.

13. Use '-=' in a function to reduce value.

14. Subtract float using '-='.

15. Use '-=' in list value update.

16. Multiply a variable by 2 using '*='.

17. Use '*=' to calculate power of 2.

18. Use '*=' with string to repeat characters.

19. Use '*=' with float value.

20. Use '*=' inside a loop for factorial.

21. Divide a variable by 2 using '/='.

22. Use '/=' with float result.

23. Demonstrate floating-point division using '/='.

24. Chain '/=' with other operators.

25. Use '/=' in function return.


26. Perform floor division using '//='.

27. Use '//=' on negative values.

28. Use '//=' in a loop to reduce value till zero.

29. Apply '//=' on float and integer.

30. Use '//=' in rounding logic.

31. Use '%=' to get remainder of division.

32. Use '%=' in looping logic (e.g., wrap-around).

33. Combine '%=' with conditional check.

34. Apply '%=' on float.

35. Use '%=' to cycle through list indices.

36. Use '**=' to raise to power 2.

37. Use '**=' to generate exponential growth.

38. Apply '**=' in scientific calculation.

39. Use '**=' with float base.

40. Combine '**=' in loop to simulate power series.

41. Mix '+=', '-=', '*=' in a program.

42. Create a calculator using assignment operators.

43. Use assignment operators in class methods.

44. Use all assignment operators on same variable.

45. Use in temperature conversion formulas.

46. Update coordinates in a game using assignment operators.

47. Simulate bank account balance with '+=', '-='.

48. Physics formula (velocity, distance) using assignment operators.

49. Track inventory count using assignment operators.

50. Convert hours to minutes and seconds using '*=', '+='.

You might also like