From a7bab58408a7d073abb370152c3911559643b838 Mon Sep 17 00:00:00 2001 From: Yukti-09 <44090430+Yukti-09@users.noreply.github.com> Date: Fri, 12 Jun 2020 17:10:51 +0530 Subject: [PATCH] Create ex.txt --- ex.txt | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 ex.txt diff --git a/ex.txt b/ex.txt new file mode 100644 index 0000000..3e5668f --- /dev/null +++ b/ex.txt @@ -0,0 +1,13 @@ +i = 0 +while i<=5: + print(i,end=' ') + i += 1 +else: + print(i,end=' ') + + OUTPUT: + 0 1 2 3 4 5 6 + + + Most langauges do not allow an else statement without an if. + However, python allows the else statement to be executed without the if provided the loop before it has not been terminated by a break statement.