What is the output of the given below program?
a = 25
if a > 15:
print("Hi")
if a <= 30:
print("Hello")
else:
print("Know program")
Share
What is the output of the given below program?
a = 25
if a > 15:
print("Hi")
if a <= 30:
print("Hello")
else:
print("Know program")
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Answer:
The provided program has an indentation issue, which is crucial in Python to define the scope of the code blocks. However, assuming that the code is corrected, here's the expected output:
```python
a = 25
if a > 15:
print("Hi")
if a <= 30:
print("Hello")
```
The output of this program would be:
```
Hi
Hello
```
Both conditions are true, so both "Hi" and "Hello" will be printed.