Page 194 - AI Ver 3.0 Class 11
P. 194

# Output the final amount after applying the discount
                   print(f"Total Amount: Rs. {total_purchase_amount:.2f}")
                   print(f"Discount Rate: {discount_rate * 100}%")

                   print(f"Discounted Amount: Rs.{discounted_amount:.2f}")
              Output:

                  Enter the total purchase amount: Rs. 5500
                  Congratulations! You get a 5% discount.
                  Total Amount: Rs. 5500.00
                  Discount Rate: 5.0%
                  Discounted Amount: Rs. 5225.00


                               Task                                                   #Coding & Computational Thinking



                   Write Python scripts for the following:

                   1.  Accept 2 numbers from the user and display the larger number.






















                   2.   Accept a number from the user. Check if the digit in the unit’s place is odd or even. Example: if the user
                      enters 452, 2 is the digit in the unit’s place and is an even number.




























                    192     Touchpad Artificial Intelligence (Ver. 3.0)-XI
   189   190   191   192   193   194   195   196   197   198   199