Respuesta :
Answer:
# Printing a statement
print("Welcome to Module 4: Making Decisions in Python")
# Declaring variables (integer and float)
my_integer = 10
my_float = 3.14
# Using if, else, nested if, and elif statements
score = 85
# Check the grade
if score >= 90:
grade = "A"
elif score >= 80:
grade = "B"
elif score >= 70:
grade = "C"
elif score >= 60:
grade = "D"
else:
grade = "F"
# Print the grade
print("Your grade is:", grade)
# Nested if statements example: Checking eligibility for a discount based on age and membership
age = 25
membership = True
if age >= 65:
print("You are eligible for a senior discount.")
else:
if membership:
print("You are eligible for a membership discount.")
else:
print("You are not eligible for any discount.")
# Check if a number is even or odd
num = 15
if num % 2 == 0:
print("The number is even")
else:
print("The number is odd")
# Check eligibility of age to vote
age = 20
if age >= 18:
print("You are eligible to vote")
else:
print("You are not eligible to vote")
# Determine whether the number is positive, negative, or neutral
number = -5
if number > 0:
print("The number is positive")
elif number < 0:
print("The number is negative")
else:
print("The number is neutral")