Tuesday, 1 February 2022

Python practice programs for beginners - Day6

 

Python practice programs for beginners - millioninformations

Welcome to the 30-day challenge of Python practising for beginners.

Day 5 practice program:

Practice all the Arithmetic Operators given:

Arithemtic Operators:


Addition --> +
Subtraction --> -
Multiplication --> *
Division (Quotient) --> /
Division (Remainder) --> %
Exponentiation --> **
Floor Division --> //

Program:



Output:




Day 6:
Formatting:


In the above output, you can see the output are getting displayed but it is not that clear to the user.

So we will use String formatting.

Syntax:


print(f'yout text {your variable}')


Example:



Output:




Day 6 Task:


Try to apply the formatting to all the other arithmetic operators.

Try to complete the task.

The output will be displayed in the next post.



1 comment :