Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hi, I would like to solve these options using Python The output of 27%6+5 is a. 8 b. 5 C. 38 d. 6 The statement

Hi, I would like to solve these options using Python

The output of 27%6+5 is

a. 8

b. 5

C. 38

d. 6

The statement x = 0 % 5 assigns a value of 5 to variable x ?

a. True

b. False

The statements a+-2 and a=a-(-2) are not equivalent

a. True

b. False

Let Ist-[1,2,3,4]. What is Ist[Ist[2]]

a. 1

b. 2

c. 3

d. 4

The expression 8/4* 2 is equal to 1

a. True

b. False

What will be the output of the following program

Sl="Welcome to JAVA Programming" S2=S1.replace("JAVA"," Python")

print (S1)

print (S2)

a. Welcome to JAVA Programming

b. Welcome to Python Programming

c. Welcome to Java Python Programming

d. None of the above

What is the output of the last line of the python program >>>word-'maths'

>>>word[:3] +word[3:] '

a. 'th "

b. 'maths '

c. 'mahs "

d. 'matths

What will be the output of the following code fragment assuming num is 10

num=10

if num == 20:

print ('Apple')

print ('Grapes')

print ('No Output')

a. Apple

b. Grapes

C. Apple Grapes

d. No Output

What will be the output of following program after the execution of the following code

X = 0

Y= 0

if x > 0:

y = y +1

else:

if x < 0

y = y + 2

else

y = y + 5

print ( Y =',y)

a. 1

b. 0

C. 2

d. 5

Which of the following is the same as s[0:-1]

a. s[-1]

b.[:]b. s

C. S[:len(s)-1]

(d. s[0:len(s)]

Consider the following code

X = 1

y = 2

count=0

if x > 0:

count = count + 1

elif

x + y < 4

count = count + 2

if y - x >= 1

count = count + 3

else: count = count * 2

After running this code, what is the result of evaluating the variable count

a. 1 b. 2 c. 4

Q2:What is the value of num_ cakes at the end of this code

>>> num_cakes =2

num_children = 15

if 0 <= num_children <= 8

num_cakes -=1

elif 8 < num_children <= 16

num_cakes += 0

else: num_cakes += 2

a. 1 b. 2 C. 3 d. None of the above

Q3:Determine the final value of num boxes

num_boxes =0

num_apples = 9

if num_apples < 10

if num apples < 5

num_boxes = 7

else: num_boxes = 2

elif num_apples < 20:

num_boxes = num_boxes + 1

a. 1

b. 2

C. 0

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

Step: 3

blur-text-image

Ace Your Homework with AI

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

Get Started

Students also viewed these Databases questions

Question

What are Decision Trees?

Answered: 1 week ago

Question

What is meant by the Term Glass Ceiling?

Answered: 1 week ago