Computer Science, asked by ap0600405, 1 month ago

A=20 B=340
PRINT(''A'') IF A>B ELSE PRINT (''B'')

Answers

Answered by Anonymous
4

Finding output - Python

First of all, the cօde won't compile. If you run the program directly then it would throw a syntax error.

Let's correct the program for better understanding.

A = 20

B = 340

if A > B:

     print("A")

else:

     print("B")

Our cօde returns: B

By seeing the program we can conclude that it is if else python statement.

An if else Python statement tells us whether an expression is equal to true or false. If the expression is true, the \tt{if} statement executes. Otherwise, the \tt{else} statement executes.

Let's walk through how our cօde works. First, we declare two Python variable called A and B. We use an if statement to determine whether A is greater than B or not.

If A is greater than B, the \tt{print()} statement after our if statement is executed. Otherwise, the the \tt{print()} statement after our Python if, else clause is executed.

Since B is greater than A, the indented statement runs, and "B" is output. The Python interpreter executes our \tt{else} statement.

Answered by juwairiyahimran18
0

Finding output - Python

First of all, the cօde won't compile. If you run the program directly then it would throw a syntax error.

Let's correct the program for better understanding.

A = 20

B = 340

if A > B:

print("A")

else:

print("B")

Our cօde returns: B

By seeing the program we can conclude that it is if else python statement.

An if else Python statement tells us whether an expression is equal to true or false. If the expression is true, the \tt{if}if statement executes. Otherwise, the \tt{else}else statement executes.

Let's walk through how our cօde works. First, we declare two Python variable called A and B. We use an if statement to determine whether A is greater than B or not.

If A is greater than B, the \tt{print()}print() statement after our if statement is executed. Otherwise, the the \tt{print()}print() statement after our Python if, else clause is executed.

Since B is greater than A, the indented statement runs, and "B" is output. The Python interpreter executes our \tt{else}else statement.

Similar questions