Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please give the expected output from the given code samples. If the code will result in an error (which some may) please correct the error

Please give the expected output from the given code samples. If the code will result in an error (which some may) please correct the error so it will properly run and then give the output. NOTE: any errors in spacing or quotes are not intentional, Word will sometimes change spacing and symbols. Uses Python code

if (var == 9418):

print("Hmmm. That is a very specific number")

elif (var > 3):

print("I do not like your number")

if (var % 2 == 0):

print("At least your number is even")

else:

print("What an ODD choice")

else:

print("I like small numbers")

print("Thanks for playing")

For Questions 1-5 use the above code.

  1. var = 5
  2. var = 2
  3. var = 8
  4. var = 9418
  5. var = -3

For question 6, assume the user has input a 4 as the user input.

  1. Num = input("Enter an Integer")

if Num > 2:

print(num / 2)

else:

print(num + 3)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Visual Basic Net Database Programming

Authors: Rod Stephens

1st Edition

0789726815, 978-0789726810

More Books

Students also viewed these Databases questions

Question

What roles have these individuals played in your life?

Answered: 1 week ago

Question

1. Write down two or three of your greatest strengths.

Answered: 1 week ago