Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write Code Questions 20. Write code that reads in 3 words one at a time, then creates a list containing all 3 words. 21.
Write Code Questions 20. Write code that reads in 3 words one at a time, then creates a list containing all 3 words. 21. Write a program that reads in an integer from the user and then outputs whether that value is odd or even. 22. Rewrite the following code fragment without a nested if-else statement. The new code should not have a nested if statement, but should only include one if-else statement using logical and relational operators. Your new code should be shorter, clearer, and easier to read but functionally perform the same as the original code. 1a #some value 2 b #some value 3 4 if a 0: print ("Error, both a and b must be non-negative") 6 else: 34567890 10 if b < 0: print ("Error, both a and b must be non-negative") else: print("Please proceed.") 23. Write a program that takes 3 floating point values from the user and creates a list. After the list creation, this program should then ask the user whether they wish to add or delete a value. Based on the response from the user, implement the appropriate code to add or delete a specific value provided by the user. Finally before the program terminates, output the list to the user. 24. Write a program that takes 3 floating point values from the user. Without creating a list or otherwise grouped data type, output the 3 values in descending order.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Code for Question 20 python words for i in range3 word inputEnter a word wordsappendword printList o...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