0% found this document useful (0 votes)
1 views3 pages

Challenges 1

The document outlines a series of Python programming challenges focused on arithmetic operators, specifically floor division and modulo. Each challenge involves distributing items such as cake slices, chocolates, water stations, pencil packs, and printing pages, with outputs demonstrating the results of the calculations. The challenges are designed to help users practice and understand the use of arithmetic operators in Python.

Uploaded by

Karthickraja K
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)
1 views3 pages

Challenges 1

The document outlines a series of Python programming challenges focused on arithmetic operators, specifically floor division and modulo. Each challenge involves distributing items such as cake slices, chocolates, water stations, pencil packs, and printing pages, with outputs demonstrating the results of the calculations. The challenges are designed to help users practice and understand the use of arithmetic operators in Python.

Uploaded by

Karthickraja K
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/ 3

TECH CLUB ACTIVITY

Python Arithmetic Operator Challenges

1. Challenge: Cake Slices Distribution


A= 25 # A is Num of cake slices
B=6 # B is Num of friends
Slices_for_friend= A // B # how many cakes are share the each friend,floorOP
Remain_slices= A % B # remaining slices, modulo operator
print("Each friend gets:" Slices_for_friend,)
print("Leftover slices:", Remain_slices)

OutPut:
Each friend gets: 4
Leftover slices: 1

2. Challenge: Currency Exchange


A= 345 # A is total rupee
B = 23 # B is each chocolate rupee
Chocolates_buy= A // B # how many chocolate buy by total rupee,floorOP
Money_remain= A % B # remaining money, modulo operator
print("Chocolates bought:", Chocolates_buy)
print("Remaining rupees:", Money_remain)

OutPut:
Chocolates bought: 15
Remaining rupees: 0
3. Challenge: Marathon Water Stops
A= 42 # A is total Kilometer
B=5 # B is each water station
water_Station= A // B # how many water station,floorOP
distance_remain= A % B # remaining distance, modulo operator
print("Water stations:",water_Station )
print("Remaining distance:",distance_remain )

OutPut:
Water stations: 8
Remaining distance: 2

4. Challenge: Pencil Packs


A= 278 # A is totalpencils
B = 12 # B is a per one box of pencils
full_boxes= A // B # how many full boxes are in pencils,floorOP
remain_pencils= A % B # remaining pencils, modulo operator
print("Full boxes:",full_boxes)
print("Leftover pencils:",remain_pencils)

OutPut:
Full boxes: 23
Leftover pencils: 2
5. Challenge: Printing Pages
A= 247 # A is total pages
B = 15 # B is per min print a page
full_minutes= A // B # how many min to print the pages,floorOP
last_minutes = A % B # remaining last min of pages, modulo operator
print("Full minutes:",full_minutes)
print("Pages in last minute:",last_minutes)

OutPut:
Full minutes: 16
Pages in last minute: 7

You might also like