Answered step by step
Verified Expert Solution
Question
1 Approved Answer
5_1.py file #***************************************************************************** # Name: # User name: # Homework No: Lab 5 # Date Due: 5:05pm Tue, March 5, 2019 # # Description: #
5_1.py file
#*****************************************************************************
# Name:
# User name:
# Homework No: Lab 5
# Date Due: 5:05pm Tue, March 5, 2019
#
# Description:
# A brief but complete description of what the program does
#
# Bug Report:
# A description of the known bugs in the program you could not fix.
# If you did not implement specific functionality, that should be reported
# in this section as well
#*****************************************************************************
a = float(input("a:"))
b = float(input("b:"))
if a 12:
print(a)
if b == 15:
print(b)
elif b
print(b)
else:
print(b)
elif a == 10 and b == 12:
print(a)
print(b)
else:
print(a)
print(b)
5_2.py file
#*****************************************************************************
# Name:
# User name:
# Homework No: Lab 5
# Date Due: 5:05pm Tue, March 5, 2019
#
# Description:
# A brief but complete description of what the program does
#
# Bug Report:
# A description of the known bugs in the program you could not fix.
# If you did not implement specific functionality, that should be reported
# in this section as well
#*****************************************************************************
a = float(input("a:"))
b = float(input("b:"))
if a 12:
if b == 15:
print(a)
print(b)
elif b
print(b)
else:
print(b)
elif a == 10 and b == 12:
print(a)
print(b)
else:
print(a)
print(b)
5_3.py file
#*****************************************************************************
# Name:
# User name:
# Homework No: Lab 5
# Date Due: 5:05pm Tue, March 5, 2019
#
# Description:
# A brief but complete description of what the program does
#
# Bug Report:
# A description of the known bugs in the program you could not fix.
# If you did not implement specific functionality, that should be reported
# in this section as well
#*****************************************************************************
a = float(input("a:"))
b = float(input("b:"))
if a
if b > 6:
print(a - b)
elif b == 6:
print(b)
else:
print(a + b)
else:
print(a)
5-1 optimized py file
#*****************************************************************************
# Name:
# User name:
# Homework No: Lab 5
# Date Due: 5:05pm Tue, March 5, 2019
#
# Description:
# A brief but complete description of what the program does
#
# Bug Report:
# A description of the known bugs in the program you could not fix.
# If you did not implement specific functionality, that should be reported
# in this section as well
#*****************************************************************************
a = float(input("a:"))
b = float(input("b:"))
print(a)
print(b)
5-2 optimized py file
#*****************************************************************************
# Name:
# User name:
# Homework No: Lab 5
# Date Due: 5:05pm Tue, March 5, 2019
#
# Description:
# A brief but complete description of what the program does
#
# Bug Report:
# A description of the known bugs in the program you could not fix.
# If you did not implement specific functionality, that should be reported
# in this section as well
#*****************************************************************************
a = float(input("a:"))
b = float(input("b:"))
if a 12:
if b == 15:
print(a)
else:
print(a)
print(b)
5-3optimized py file
#*****************************************************************************
# Name:
# User name:
# Homework No: Lab 5
# Date Due: 5:05pm Tue, March 5, 2019
#
# Description:
# A brief but complete description of what the program does
#
# Bug Report:
# A description of the known bugs in the program you could not fix.
# If you did not implement specific functionality, that should be reported
# in this section as well
#*****************************************************************************
a = float(input("a:"))
b = float(input("b:"))
if a
if b > 6:
print(a - b)
elif b == 6:
print(b)
else:
print(a + b)
print(a)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started