Determining the python programming

Assignment Help Basic Computer Science
Reference no: EM132129362

Python programming

Please I would like some help in checking if my source code for is susceptible to short-circuit evaluation.I don't need answers, I just need corrections. The source code is to check the integer parts of the both numbers to see if they are even or odd, and prints exactly one of the following messages on the screen:

The decimal part of the both numbers is odd. or

The decimal part of the both numbers is even. or

The decimal part of the number a is even, but the decimal part of the number b is odd. or

The decimal part of the number a is odd, but the decimal part of the number b is even.

Source code:

#Part2 - odd & even number

enter3 = print("Please enter two numbers: ")

enter4 = int(float(input("Enter number 1: ")))

enter5 = int(float(input("Enter number 2: ")))

if (enter4%2 == 0) and (enter5%2 == 0):

  print("The decimal part of both numbers is even.")

elif (enter4%2 != 0) and (enter5%2 != 0):

  print("The decimal part of both numbers is odd.")

elif (enter4%2 == 0) and (enter5%2 != 0):

  print("The decimal part of the number a is even, but the decimal part of the number b is odd.")

else:

  print("The decimal part of the number a is odd, but the decimal part of the number b is even.")

Reference no: EM132129362

Questions Cloud

Instruction sets in making the right balance : Please discuss the design principles that guide the authors of instruction sets in making the right balance.
Should she fire jack or give him another chance : Explain the events in this case in terms of perception and attitudes. Does personality play a role? Should she fire Jack or give him another chance?
How does a java server page uses the client-server model : How does a Java Server Page uses the client-server model to make a Web page interactive?
Case prove that the result is minimal : Find minimal dfa's for the following languages. In each case prove that the result is minimal.
Determining the python programming : Please I would like some help in checking if my source code for is susceptible to short-circuit evaluation.I don't need answers, I just need corrections.
Examples that you can think of using technology : What are some examples that you can think of using technology, that have greatly changed the way we do things?
Provide an example applying criteria : Discuss the criteria necessary to establish a factor as a confounder and provide an example applying these criteria?
Find the line-to-line voltage at the bus : Find line-to-line voltage at the bus, which supplies 440-V line at a three-phase 18-hp motor operating at full load, 86% efficient and 85% power factor lagging
Write code in the method binarysearch : Write code in the method binarySearch() in "SearchMethods" class which finds the element in an array using binary search approach and returns

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Describe the characteristics and actions of a work group

Using Tuckman's Five-Stage Model of Group Development, describe the characteristics and actions of a work group for your present or former organization throughout their development process. If possible, use a work group in which you belonged.

  What function does same gate compute using positive logic

A certain two-input gate computes the exclusive-OR function using negative logic. What function does the same gate compute using positive logic?

  Identical production functions

An industry has 100 firms. These firms have identical production functions. In the short run, each firm has fixed costs of $400. There are two variable factors

  Give an algorithm to find a majority element

Give an algorithm to find a majority element if one exists, or reports that one does not. What is the running time of your algorithm?

  Create a florida state information system

Create and use a Microsoft Access Database from which the program will retrieve the city information. Include 1 table with 5 fields per row, and 10 rows of data (cities).

  Designing cryptographic protocols

For each, give an example where their principle applies and results in an improved protocol.

  Compare the profit per firm under cournot and stackelberg

Compare the profit per firm under Cournot and Stackelberg. Which market would you rather operate in?

  Desire a surmountable challenge

Movie Trivia, Guess a number between 1-10, Dice, etc. Note: Avoid games with lots of complex combinations like card games, i.e. poker, unless you desire a surmountable challenge. The real goal is for you to demonstrate the use of the design tool t..

  Write an sql command to create the customer table

Write an SQL command to add a new record to the CUSTOMER table for Customer Number 9442. The Customer Name is Smith Hardware Stores, the responsible salesperson is Salesperson Number 577, and the HQ City is Chicago.

  Find the available fonts on the user''s system

Enhance the font viewer program to allow the user to select different fonts. Research the API documentation to find out how to find the available fonts on the user's system.

  Write a program that reads from the external file

write a program that reads from the external file input.txt, counts the letters in every word , replaces the word by that number and then writes the numbers to an external file output.txt (note: do not forget to copy the blanks

  What is the purpose of using a document naming convention

What is the purpose of using a document naming convention? Describe at least three types of information that the file name could contain.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd