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
RUDIKE [14]
3 years ago
13

Write an if-else statement with multiple branches. If givenYear is 2101 or greater, print "Distant future" (without quotes). Els

e, if givenYear is 2001 or greater (2001-2100), print "21st century". Else, if givenYear is 1901 or greater (1901-2000), print "20th century". Else (1900 or earlier), print "Long ago".
Computers and Technology
2 answers:
Komok [63]3 years ago
7 0

<em>year </em>= 2101

if <em>year </em>=> 2101 then

print ("Distant future");

else if <em>year </em>=> 2001 then

print ("21st Century");

else if <em>year </em>=> 1901 then

print ("20th Century");

else if <em>year </em><1901 then

print ("Long Ago");

<h2>Further Explanation </h2>

There are three types of conditionals in Python, which you can use to build a logic flow for your program. Python has the if, if..else, and if..elif..else statements.

To check conditions that do not meet the main conditions. Then else is used to handle all conditions other than the conditions that have been written.

If there are enough conditions to define, you can add other conditions by using the elif under the if statement and before the else statement.

And of course, a conditional can be stored in another if.

If Else condition

Decision making (if-else conditions) is not only used to determine what actions will be taken in accordance with the conditions but also is used to determine what actions will be taken/carried out if the conditions are not appropriate.

In python, there are several statements/conditions including if, else and elif The if the condition is used to execute code if the condition is true.

The condition if-else is a condition where if the statement is true True then the code in if will be executed, but if it is false False it will execute the code in else.

Learn More

if-else statement brainly.com/question/10798332

Conditional if in python brainly.com/question/10798332

Detail

Class: High School

Subject: Computers and Technology

Keyword: If-Else, Python, Code

RideAnS [48]3 years ago
3 0

#include <stdio.h>

int main(void) {

int givenYear;

givenYear = 1776;

if(givenYear >= 2100){

printf("Distant future");

}

else if (givenYear >= 2001){

printf("21st century");

}

else if (givenYear >= 1900){

printf("20th century");

}

else {

printf("Long ago");

}

return 0;

}

You might be interested in
HELP ASAP!!!
Crazy boy [7]
The answer is a C..ur welcome
5 0
4 years ago
Instant messaging allows text only <br> a. True <br> b. False
xenn [34]
False!                           

There are other things you can do like send pictures and etc.
6 0
4 years ago
Jabari is writing pseudocode for a new video game he wants to create. What should he include in his pseudocode?
erastova [34]

Answer:

The answer is "Option c".

Explanation:

The Pseudocode is a definition of actions in an algorithm or some other method of software engineering. It also uses regular programming language, formal conventions, and is associated with human learning rather than computer learning, and the wrong choice can be defined as follows:

  • In choice a, It is wrong because there are so many languages, and it is not easy to understand all.
  • In choice b, It is wrong because it is used for better understanding.
  • In choice d, it is wrong because words are also not only common to programmers.
5 0
3 years ago
For each of the following scenarios, write down what feature should be used in
inessss [21]

Answer:

d

Explanation:

5 0
3 years ago
1. The purposes of traffic signs are
Wittaler [7]

Answer:

<em>D. to regulate, to warn, to guide.</em>

3 0
3 years ago
Other questions:
  • Which expansion slot is used by an NVMe compliant device?
    9·1 answer
  • Proxy data:
    12·1 answer
  • TCP will guarantee that your packets will arrive at the destination, as long as the connection is still established. True False
    11·1 answer
  • The process of recognizing information? needs, using efficient search techniques to locate reliable sources of? information, and
    9·1 answer
  • Women make up 52 percent of the voting-age population and are more likely to vote, yet
    12·2 answers
  • ( Game Design) The companies who get video games out to consumers are called:
    12·1 answer
  • cellPhoneBill(m,tx)Write the function cellPhoneBill()that takes two int m and txas input and returns a float.The function takes
    11·1 answer
  • You have a large text file of people. Each person is represented by one line in the text file. The line starts with their ID num
    5·1 answer
  • MR. Tom asked her students could they plant a flower and bring it to class. Sarah brought his flower and said it was a rose. Jam
    6·1 answer
  • Question 18
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!