1.4.1: Basic syntax errors. Retype the statements, correcting the syntax error in each print statement. print('Predictions are hard.") print(Especially about the future.) user_num = 5 print('user_num is:' user_num)
Added by Brittany M.
Close
Step 1
The first statement is correct. It prints the string "Predictions are hard." So, we don't need to change anything here. Show more…
Show all steps
Your feedback will help us improve your experience
Akash M and 95 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Write a Java program called Decision that includes a while loop to prompt the user to enter 5 marks using theJOptionPane statement and a System.out statement to output a message inside the loop highlighting a passmark >= 50 and <= 100. Any other mark will output a messaging stating it’s a fail.Example of the expected output is as follows:55 is a pass12 is a fail
Supreeta N.
Wrap your code from Question 5 in a while loop so the user can continue entering numbers even if they make a mistake and enter text instead of a number. The code is: # Input two numbers num1 = int(input("Enter first number: ")) num2 = int(input("Enter second number: ")) # Print the result print("The sum of the numbers is:", (num1 + num2)) # TypeError will be handled by ValueError except ValueError: # Print the friendly message print("Please enter an integer...")
Shelayah R.
Write code that iterates while userNum is less than 14. Each iteration: Put userNum to output. Then, put "_" to output. Then, assign userNum with userNum multiplied by 3. Ex: If input is 1, then output is: 1_3_9_ integer userNum // Program will be tested with 1, 3, 5, and 14 userNum = Get next input // Your solution goes here
Samuel G.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Transcript
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD