Skip to content

Commit

Permalink
Fix for W1309: Using an f-string that does not have any interpolated …
Browse files Browse the repository at this point in the history
…variables (f-string-without-interpolation)
  • Loading branch information
oneananda committed Oct 27, 2024
1 parent cd99923 commit 66f2922
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions 0009-If-Else-Elif/if_else_elif.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,25 @@

AGE = 40

print(f"If-example")
print("If-example")
AGE = 18
if AGE >= 18:
print("You are eligible to vote.")

print(f"======================================================")

print("======================================================")
print()

print(f"If-else-example")
print(f"Hospital admission when the age is {AGE}")
print("If-else-example")
print("Hospital admission when the age is {AGE}")

if AGE <= 18:
print("You should be admitted to the Pediatric Department.")
else:
print("You should be admitted to the Adult Department.")
print(f"======================================================")
print()

print(f"If-else-with-multiple-lines-example")
print("If-else-with-multiple-lines-example")
print(f"Hospital admission when the age is {AGE}")

if AGE <= 18:
Expand All @@ -32,10 +33,10 @@
else:
print(f"Your age is {AGE}.")
print("You should be admitted to the Adult Department.")
print(f"======================================================")
print("======================================================")
print()

print("if-elif-else example")

print("elif = else if")

MARKS = 85
Expand All @@ -48,7 +49,7 @@
else:
print("Grade: D")
print(f"======================================================")

print()

print("Nested if Statements example")

Expand All @@ -62,7 +63,7 @@
print("Negative number")

print(f"======================================================")

print()

print("Using Logical Operators example")

Expand All @@ -71,9 +72,9 @@
has_id = True

if AGE >= 18 and has_id:
print(f"You can enter the club, as your age is {AGE}.")
print("You can enter the club, as your age is {AGE}.")
else:
print(f"Entry denied, as your age is {AGE}.")
print("Entry denied, as your age is {AGE}.")


print(f"======================================================")
print("======================================================")

0 comments on commit 66f2922

Please sign in to comment.