Find Jobs
Hire Freelancers

Small Python Project

$10-30 USD

Abgeschlossen
Veröffentlicht vor mehr als 5 Jahren

$10-30 USD

Bezahlt bei Lieferung
define a main() function, a doTestOne() function, a doTestTwo() function and a doTestThree() function. The main() function should call doTestOne(), doTestTwo() and doTestThree() In doTestOne() Prompt the user for a number (e.g., "Please enter an integer.") Using input() store it in a variable called "userInput" Convert the number from text to an integer Determine whether or not the number is an even number by using the modulo operator. Hint: The expression x % 2 == 0 (modulo operator) evaluates to True when the remainder of x divided by 2 is 0. If the number is even, print "Number entered is even" If the number is odd, print "Number entered is odd" In doTestTwo() Prompt the user with the question (“Are you hungry? (Enter only yes or no) ” And save the result in a variable namely ‘hungry’) Prompt the user with the question (“Are you thirsty? (Enter only yes or no) ” And save the result in a variable namely ‘thirsty’) Depending on the answer, set the result to the appropriate boolean value (True or False). (Remember the user can enter the answer in any way, uppercase, lowercase etc., Handle it correctly) Write code that tests 'hungry' and 'thirsty' for all possible combinations of True and False. There are four possibilities. For example, hungry and thirsty can both be true, or both be false or one true and the other false. Print the appropriate statement saying whether the user is hungry and/or thirsty based on conditions using 'if' and 'elif' (Example "Take a bite" and "Drink the coke") In doTestThree() Prompt the user for a number (e.g., "Please enter an integer.") Using input() retrieve the number entered by the user and store it in a variable called, "userInput" Convert the number to an integer Using if and else statements, determine if the number entered is: Divisible by 2 and 3 Divisible by 2 and not 3 Divisible by 3 and not 2 Print the appropriate outcome as shown above. Don't forget to execute the main function as your last line in the program. Add appropriate comments to the program and describe what each function does above the functions in comments.
Projekt-ID: 17781837

Über das Projekt

2 Vorschläge
Remote Projekt
Aktiv vor 6 Jahren

Möchten Sie etwas Geld verdienen?

Vorteile einer Ausschreibung auf Freelancer

Legen Sie Ihr Budget und Ihren Zeitrahmen fest
Für Ihre Arbeit bezahlt werden
Skizzieren Sie Ihren Vorschlag
Sie können sich kostenlos anmelden und auf Aufträge bieten
Vergeben an:
Avatar des Nutzers
Hello, I am experienced excel expert. I can help with this task with quick turnaorund. Looking to hearing from you. Kind regards
$30 USD in 1 Tag
4,9 (71 Bewertungen)
6,0
6,0
2 Freelancer bieten im Durchschnitt $35 USD für diesen Auftrag
Avatar des Nutzers
hello this is Asad, i have a vast experience in python programming, if you need an A grade contact me right now.
$40 USD in 1 Tag
4,9 (64 Bewertungen)
6,4
6,4

Über den Kunden

Flagge von UNITED STATES
Austin, United States
5,0
3
Zahlungsmethode verifiziert
Mitglied seit Sept. 17, 2018

Kundenüberprüfung

Danke! Wir haben Ihnen per E-Mail einen Link geschickt, über den Sie Ihr kostenloses Guthaben anfordern können.
Beim Senden Ihrer E-Mail ist ein Fehler aufgetreten. Bitte versuchen Sie es erneut.
Registrierte Benutzer Veröffentlichte Jobs
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Vorschau wird geladen
Erlaubnis zur Geolokalisierung erteilt.
Ihre Anmeldesitzung ist abgelaufen und Sie wurden abgemeldet. Bitte melden Sie sich erneut an.