CBSE Class 11 Computer Science Question 27 of 27

Getting Started with Python — Question 1

Back to all questions
1
Question

Question 1

Write instructions to get the following result :

Math is Fun so don't be resistant
Just learn the rules, the rules are consistent 
And most important, you must be persistent !

Adding fractions, get common denominators.
Multiply by missing factors to get the denominators. 
Add numerators only, NOT denominators.

Do it in both interactive mode and script mode.

Answer
Interactive Mode
>>> print("Math is Fun so don't be resistant")
Math is Fun so don't be resistant
>>> print("Just learn the rules, the rules are consistent")
Just learn the rules, the rules are consistent
>>> print("And most important, you must be persistent !")
And most important, you must be persistent !
>>> print("")

>>> print("Adding fractions, get common denominators.")
Adding fractions, get common denominators.
>>> print("Multiply by missing factors to get the denominators.")
Multiply by missing factors to get the denominators.
>>> print("Add numerators only, NOT denominators.")
Add numerators only, NOT denominators.
>>>


Script Mode
Solution
print("Math is Fun so don't be resistant")
print("Just learn the rules, the rules are consistent")
print("And most important, you must be persistent !")
print("")
print("Adding fractions, get common denominators.")
print("Multiply by missing factors to get the denominators.")
print("Add numerators only, NOT denominators.")
Output
Math is Fun so don't be resistant
Just learn the rules, the rules are consistent
And most important, you must be persistent !

Adding fractions, get common denominators.
Multiply by missing factors to get the denominators.
Add numerators only, NOT denominators.