1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
saw5 [17]
3 years ago
8

Write a Python program that gets a number using keyboard input. (Remember to use input for Python 3 but raw_input for Python 2.)

If the number is positive, the program should call countdown. If the number is negative, the program should call countup. Choose for yourself which function to call (countdown or countup) for input of zero.
Computers and Technology
1 answer:
sergiy2304 [10]3 years ago
3 0

Answer:

def countup():

pass

def countdown():

pass

x = int(input("Choose a number: "))

if x >= 0:

countup()

if x < 0:

countdown()

Explanation:

I start by getting a user input which is saved to variable called "x." I then make if statements to see whether is greater than, equal to, or less than 0. After that, I call the functions.

You might be interested in
Constructors are special methods included in class definitions. a. What is a constructor used for? b. How do constructors differ
PIT_PIT [208]

Answer:

(a)A constructor is a special method which is used the initialize the class that means the initialize the object of a class.

(b)There is the following difference between constructor and method in a class.

1. Constructor name has the same name as the class name we do not give any other name to the constructor, on the other hand, it is possible in function to giving any name to function.

2. The constructor does not have return type such as int, void, etc on the other hand function must have a return type.

3.constructor does not return any value on the other hand function are returning the value.

Explanation:

Following are the program of constructor in c++

#include <iostream> // header file

using namespace std; // namespace

class constructor1

{

   public:

   constructor1() // default constuctor

   {

       cout<<" hello brainly:"<<endl;  

   }

void fun() // fuuction

{

cout<< "function:";

}

};

int main() // main function

{

constructor1 ob; // creating object it call default constructor

ob.fun();//  calling the function fun()

  return 0;

}

Output:hello brainly:

function:

In this program, we create a class and create a function "fun" and "default "constructor "from the main function we create the object of a class which calls the default constructor and with the help of object we call the function fun.

6 0
3 years ago
Interest on loan paid to sangam stores Rs5000(journal entry)​
ratelena [41]
I’m confused... whats the question?
6 0
3 years ago
Explain the information processing cycle and give examples
strojnjashka [21]
Information processing cycle - Computer Definition. The sequence of events in processing information, which includes (1) input, (2) processing, (3) storage and (4) output. The input stage can be further broken down into acquisition, data entry and validation.

That's all I got. Hope that helped a little (:
5 0
3 years ago
Coding with Loops Worksheet
vovangra [49]
Mmmmmmmmmmmmmmmmmmmmmmmm
7 0
3 years ago
Read 2 more answers
Technician A says that a vehicle may be considered non-drivable if the seat belt retractor is damaged from the collision.
Aleonysh [2.5K]

technician a is correct because if the seatbelt retractor is broke the car is toteled

7 0
3 years ago
Read 2 more answers
Other questions:
  • Telecommunications devices transmit data in the form of electrical signals. what is the technical term that we use for these sig
    14·2 answers
  • Microsoft Word is ________________ software.
    8·1 answer
  • The idea of supply and demand is based on the development of
    10·2 answers
  • Match each item with a statement below. a.Authentication b.Brute force attack c.Dictionary attack d.Password e.Shoulder surfing
    13·1 answer
  • (6 pts) Write a bash shell script called 08-numMajors that will do the following: i. Read data from a class enrollment file that
    10·1 answer
  • Abdhbhbhsbfhsbhcvdhcbsdbhsvhgvhdsgvfhsgdvfhgdsvghcghvc
    10·2 answers
  • Which statement is false? Select one: a. Function printf does not care how large the array it is printing is. b. Function scanf
    9·1 answer
  • What are the process of boots up a computer?​
    10·1 answer
  • We are supposed to go to the concert tomorrow, but it has been raining for three days straight. I just know that we won’t be abl
    5·2 answers
  • What is the following file format called? inv_nbr, inv_name, inv_cost 876521,battery,45.00
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!