1. Largest Odd Revisited: Write a program that examines three variables x, y, and z and prints out the largest odd numbe

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

1. Largest Odd Revisited: Write a program that examines three variables x, y, and z and prints out the largest odd numbe

Post by answerhappygod »

1 Largest Odd Revisited Write A Program That Examines Three Variables X Y And Z And Prints Out The Largest Odd Numbe 1
1 Largest Odd Revisited Write A Program That Examines Three Variables X Y And Z And Prints Out The Largest Odd Numbe 1 (63.2 KiB) Viewed 40 times
***PLEASE USE STARTER CODE***
1. Largest Odd Revisited: Write a program that examines three variables x, y, and z and prints out the largest odd number amongst them. If none are odd, print out a message indicating this. For this code, use a 'for' or 'while loop, conditionals, and a sorting function "sort' from the NumPy package). Make sure to add some comments in your code to indicate what appropriate lines of code are doing.
X = # largest odd revisited import numpy as np : 1; y = 7; z = 1000 # L = np.array([x, y, z]) Ls = np.sort(L)[::-1] # reverse sorted np array so largest first no_odds = True J for 1 in Ls: if l%2 != 0: print(f'??') else: pass if no odds ==True: print('no odds!')
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply