Skip to content

Latest commit

 

History

History
21 lines (13 loc) · 603 Bytes

File metadata and controls

21 lines (13 loc) · 603 Bytes

*** Control Structures in Python***

Tutedude Assignment 2

Task - 1

checking if a numbers is Even or odd

  1. In the program i took number as a variables and assigned user input to that variable.
  2. Here the user given input (means number)is divided by 2 == to "0" .
  3. if this condition is true that number will be even otherwise it's odd numbers.

Task - 2

Sum of Integers from 1 to 50 using a loop

  1. Initialize an accumulator variable for the sum.
  2. Use a for loop to iterate over numbers from 1 to 50 (inclusive)
  3. Display the final sum (outside the loop to print only once)

Thank you