GradePack

    • Home
    • Blog
Skip to content
bg
bg
bg
bg

GradePack

What will be the output of the following program? b = “Hello…

What will be the output of the following program? b = “Hello, World!”print(b[2:5])    

Read Details

Write a Python program that acts as a very basic calculator….

Write a Python program that acts as a very basic calculator. Your program should: Ask the user for two numbers. Ask the user for an operation. (addion + or subtraction -).   Perform the chosen operation on the two numbers and print the result. Include a simple check to make sure only numbers are input. Your program should loop until both numbers entered are zero.  Hint: You will need a loop and a try/except!  Sample run: Enter first number (0 to exit): 10Enter second number (0 to exit): 5Enter operation (+, -,): +Result: 15.0——————————Enter first number (0 to exit): abcInvalid input. Please enter numbers.——————————Enter first number (0 to exit): 0Enter second number (0 to exit): 0Exiting calculator. Goodbye! You should be able to complete this in 17 lines of code or fewer. However, if you go over, no points will be deducted. You do not need to use functions unless you want to.  

Read Details

x = 30if x 20:          print(“Wow”)    else:         print(…

x = 30if x 20:          print(“Wow”)    else:         print(“Done”)  

Read Details

What is the output of the following code: b = “Hello, World!…

What is the output of the following code: b = “Hello, World!”print(b[:5])

Read Details

What will the following function print out?def greet(lang):…

What will the following function print out?def greet(lang): if lang == ‘es’: return ‘Hola’ elif lang == ‘fr’: return ‘Bonjour’ else: return ‘Hello’   print(greet(‘es’),’Michael’)

Read Details

Write a  program, that asks for a radius and then will calcu…

Write a  program, that asks for a radius and then will calculate the diameter, circumference, and area of a circle.  Diameter = 2r Circumference = 2πr Area = πr2 Your program should not crash. Your program should loop until a zero value for the radius is entered.

Read Details

A tech company asks: “How likely are you to recommend this s…

A tech company asks: “How likely are you to recommend this smartwatch to a friend?”Responses range from 0 (not at all likely) to 10 (extremely likely). What measurement scale is this?

Read Details

Which of the following best distinguishes nominal from inter…

Which of the following best distinguishes nominal from interval data?

Read Details

A hotel chain asks guests to rank the following aspects of t…

A hotel chain asks guests to rank the following aspects of their stay in order of importance (1 = most important, 4 = least important): Cleanliness Price Location Staff Friendliness What type of scale is being used?

Read Details

Extra Credit — Select All That Apply. Let A be a 5×7 matrix…

Extra Credit — Select All That Apply. Let A be a 5×7 matrix. Which of the following is/are true?

Read Details

Posts pagination

Newer posts 1 … 31,219 31,220 31,221 31,222 31,223 … 86,222 Older posts

GradePack

  • Privacy Policy
  • Terms of Service
Top