Python Exercises for Practice - Exercise 1

Solution of the Python Problem!  

So, I am going to solve the Python problem which was given by the following YOUTUBE CHANNEL Named @programmingwithmosh




1. I did this myself:


For this I used the for Loop with range (range is a function of Python) and one and only print() function. ---- That's kind of Awful I Know😆.

2. This Solution is by @programmingwithmosh:


EXPLANATION:
(JAISE MUJHE LGTA H lol😂)
  • Third line is the Condition of answer.
  • And the first line is Variable for Counting and it's Initial Value is 0. (Cause now we don't know that How many Even numbers we have between 1-10).
  • The forth line is about Increment. (Assignment Operators) It will add the Value of Count i.e.  0 with +1 to the count the Increasing number of Even numbers between 1-10.
  • And the line that is print() function and f function which used when we use numbers between strings (+ Used with {}).

3. Mixture of My Logic and @programmingwithmosh:


Here, I just used 'for loop with range function' in Three Parameter so I didn't need to give Condition for the Answer.



THANKS!😎

Comments

Popular posts from this blog

Python Exercises for Practice - Exercise 3

Python Exercises for Practice - Exercise 2