Write a script to prompt the user for his/her name (name) and an integer (num). Create a menu with 4 options that loops until the user enters 4 to quit. Options 1-3 call functions odd(num), calculation(name, num), and printname(name, num). Anything but the integers 1-4 output Invalid input and re display the menu. odd(num) prints the odd numbers from 1 to num inclusive (10 numbers on a line) calculation(name, num) returns the length of name times num printname(name, num) prints name num times use if __name__ == '__main__': to include everything but the functions so zybooks can test each function individually
Write a script to prompt the user for his/her name (name) and an integer (num). Create a menu with 4 options that loops until the user enters 4 to quit. Options 1-3 call functions odd(num), calculation(name, num), and printname(name, num). Anything but the integers 1-4 output Invalid input and re display the menu. odd(num) prints the odd numbers from 1 to num inclusive (10 numbers on a line) calculation(name, num) returns the length of name times num printname(name, num) prints name num times use if __name__ == '__main__': to include everything but the functions so zybooks can test each function individually
Chapter6: Looping
Section: Chapter Questions
Problem 1GZ
Related questions
Question
Write a script to prompt the user for his/her name (name) and an integer (num). Create a menu with 4 options that loops until the user enters 4 to quit. Options 1-3 call functions odd(num), calculation(name, num), and printname(name, num). Anything but the integers 1-4 output Invalid input and re display the menu.
odd(num) prints the odd numbers from 1 to num inclusive (10 numbers on a line)
calculation(name, num) returns the length of name times num
printname(name, num) prints name num times
use
if __name__ == '__main__':
to include everything but the functions so zybooks can test each function individually
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 3 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,