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
Point giveaway and brainliest
melamori03 [73]

Thank you, pal!

You are invited to my clubhouse!

5 0
3 years ago
Read 2 more answers
Can a result that contains road maps for European countries have a highly meets rating
Mice21 [21]

Đápán3e

Explanation:

8 0
3 years ago
Effective nonverbal communication can cause tension.<br><br> True or False
agasfer [191]

Explanation:

When your nonverbal signals match up with the words you're saying, they increase trust, clarity, and rapport. When they don't, they can generate tension, mistrust, and confusion.

4 0
3 years ago
Which of the following is the single best rule to enforce when designing complex passwords?
saw5 [17]

Answer:

B. Longer passwords

Explanation:

If the password is longer, it requires more incorrect attempts to find it, so the system could identify a potential hacker attempt. Smaller but more complex passwords could be identified by mistype or forgotten passwords.

3 0
3 years ago
The matrix theory is used in the ___ technique
wlad13 [49]

Answer:

The matrix theory is used by hill cipher.

Explanation:

Th technique which uses matrix theory is hill cipher technique.

Hill cipher technique is a polygraphic substitution cipher and it is based on linear algebra.

For encrypting a message in Hill Cipher technique each block of n letters is multiplied by an invertible matrix of nxn and that to against modulus 26 and  for the decryption of the message, every block is multiplied by the inverse of the matrix that was used for encryption.

3 0
3 years ago
Other questions:
  • Which is an internet service?<br><br> Antivirus<br> Chat<br> Firewall<br> Router
    8·2 answers
  • Which statement pertaining to system reliability is FALSE? Select one: A. Having the latest version of software products can mak
    15·1 answer
  • Create an array named itemDescription containing the following item descriptions:
    15·1 answer
  • Write an expression that computes the integer average of the int variables exam1 and exam2 (both declared and assigned values).
    15·1 answer
  • You scan the network and find a counterfeit access point that is using the same SSID as an already existing access point. What i
    12·1 answer
  • which program monitors the computer by looking for known trouble makers as well as suspicious behavior​
    11·1 answer
  • Is monitor is a television​
    5·2 answers
  • (Print distinct numbers) Write a program that reads in integers separated by a space in one line and displays distinct numbers i
    8·1 answer
  • This site isn't letting me add my ans and wut should I do?
    15·1 answer
  • What computer is designed for particular application​
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!