Assignment on Operators & Control Structures In Python

 

Hello guys......!

Now it's time for the assignment. This assignment is based on chapter 2 operators and control structures in python.


## Operators & Control Structures In Python ##
1. Write a continuous while loop where you take the integer input from command prompt one by one, And if the number n is odd print "Number is odd" else print "Number is even". End the loop when Zero is entered.

2. Write a continuous while loop where you take the integer input from command prompt. The loop will continue to print "you are great", on each input integers except 8. On receiving 8, it should break the loop and print "out of loop".

3. Write a big block structure file, which when runs gives the following output
##################
## 1. Name ##
## 2. Age ##
## 3. Exit ##
##################
What is you option : _ _

This program should continuously run until option 3 is not given.
When option 1 is given it will ask for “Enter your Name”
and print “Hello” + Name.
When option 2 is given it will ask “Enter your age”
and print “Your age is” + age.

4. Print the nth summation value for following series
1^2 + 2^2 + 3^2 + 4^2 +.......
Where x^y means y to the power of x. As input a value n is pass, so the summation up to that element has to be given.

5. Print the following pattern

1
2 2
3 3 3
4 4 4 4
5 5 5 5 5


Best regards from,

msbtenote:)

THANK YOU!

Comments