Skip to content

MyUstaadG

Learn to Serve

  • Computer Science
    • Software
    • Computer Tips
    • Coding
      • Conditional Structures Exercises
      • Loops Exercises
      • Arrays Exercises
      • Python Exercises
    • Microsoft Office
      • MS Excel
      • MS Word
  • Videos
    • Funny Videos
    • Health and Fitness Videos
    • PUBG Videos
    • Technology Videos
  • News
  • Funny
  • Memes
  • Playwright Tutorials
  • Tutorials
  • Toggle search form

Write a program that asks the user for an integer and shows on the screen whether it is even or odd | Python Programming

Posted on March 23, 2022March 23, 2022 By myustaadg.com
Spread the love

Conditional Structure Exercises

Write a program that asks the user for an integer and shows on the screen whether it is even or odd.

Solution:

n = int(input("Enter an integer: "))
if n % 2 == 0:
    print("The number " + str(n) + " is even")
else:
    print("The number " + str(n) + " is odd")
Click Here For Direct Solution on Colab

#colab

#Python Programming Importance

Hope You will learn Something. Happy Coding

Programming Exercises, Python Exercises Tags:conditional exercises, conditional statment solved exerciese in python, conditional statments, conditional statments in python, conditional Structure, conditional structure codes in python, conditional structures in python, easy python lectures, easy python tutorials, python lectures, python programming, python programming tutorials, pyton lectures for beginner, solved python programming exercises

Post navigation

Previous Post: Write a program that asks the user for two numbers and shows their division on the screen. If the divisor is zero the program must display an error | Python Programming
Next Post: Write a program that asks the user their age and monthly income and shows on the screen whether the user has to pay taxes or not | Python Programming

More Related Articles

Write a program that sorts one-dimensional array of 5 elements in ascending order using insertion sort method. Arrays Exercises
Write a program that input user name and displays on the screen in python | Python Programming Programming Exercises
Write a program that inputs values into int type array. It reads the value from array and draws a bar chart by printing asterisks. Arrays Exercises
Write a program to initialize values in two tables A and B. Multiply matrix A and B and store results into table C | Multiplication of matrices. Arrays Exercises
Write a program that deletes a value from a specified location of one-dimensional array of N elements. Arrays Exercises
Write a program that asks the user their annual income and shows on the screen the tax rate that corresponds to them | Python Programming Programming Exercises

Copyright © 2022 MyUstaadG.

Powered by PressBook Blog WordPress theme