Question

What is the output of this code? my_list = [ 10, 20, 30, 40, 50, 60 ] for e in my_list: if e / 10 % 2 == 1: print( e ) else: print( '100' ) What is the output of this code? my_list = [ 10, 20, 30, 40, 50, 60 ] for e in my_list: if e / 10 % 2 == 1: print( e ) else: print( '100' ) 10 100 30 100 50 100 10 100 100 100 100 100 10 30 50 100 20 100 40 100 60

          What is the output of this code?
my_list = [ 10, 20, 30, 40, 50, 60 ]
for e in my_list:
    if e / 10 % 2 == 1:
        print( e )
    else:
        print( '100' )
What is the output of this code?
my_list = [ 10, 20, 30, 40, 50, 60 ]
for e in my_list:
    if e / 10 % 2 == 1:
        print( e )
    else:
        print( '100' )
10 100 30 100 50 100
10 100 100 100 100 100
10 30 50
100 20 100 40 100 60
        
Show more…

Added by Alejandro W.

Computer Science and Information Technology
Computer Science and Information Technology
Trishna Knowledge Systems 2018 Edition
AceChat toggle button
Close icon
Ace pointing down

Please give Ace some feedback

Your feedback will help us improve your experience

Thumb up icon Thumb down icon
Thanks for your feedback!
Profile picture
What is the output of this code? my_list = [ 10, 20, 30, 40, 50, 60 ] for e in my_list: if e / 10 % 2 == 1: print( e ) else: print( '100' ) What is the output of this code? my_list = [ 10, 20, 30, 40, 50, 60 ] for e in my_list: if e / 10 % 2 == 1: print( e ) else: print( '100' ) 10 100 30 100 50 100 10 100 100 100 100 100 10 30 50 100 20 100 40 100 60
Close icon
Play audio
Feedback
Powered by NumerAI
Danielle Fairburn David Collins
Jennifer Stoner verified

Kumareshwaran Rathinasabapathy and 69 other subject AP CS educators are ready to help you.

Ask a new question

*

Labs

-

Want to see this concept in action?

NEW

Explore this concept interactively to see how it behaves as you change inputs.

View Labs

*

Key Concepts

-
Key Concept
Premium Feature
Explore the core concept behind this problem.
Play button
Key Concept
Premium Feature
Explore the core concept behind this problem.
Your browser does not support the video tag.

*

Recommended Videos

-
what-is-the-output-of-the-following-program-20-let-mathrmi1-30-read-mathrmx-mathrmy-40-data-5-4-50-l

What is the output of the following program? 20 Let $\mathrm{I}=1$ 30 Read $\mathrm{x}, \mathrm{y}$; 40 Data 5, 4; 50 Let $S=X$ 60 Print $S$ 70 If $\mathrm{I}=\mathrm{Y}$, then go to 100 80 Let $S=S * X$ 90 Let $\mathrm{I}=\mathrm{I}+1$ 100 Go to 60 110 End (1) 5 25 625 (2) 625 25 5 (3) 5 25 125 625 (4) 125 25 5

The IIT Foundation series of Mathematics Class

consider-the-following-python-code-what-is-the-output-def-fx-50-y-50-returnxy-x-y-x-y-fy-100-x-50-printx-y

Consider the following python code. What is the output? def f(x = 50, y = 50): return(x+y, x-y) x, y = f(y = 100, x = 50) print(x, y)

Urvashi A.

k-what-is-the-output-of-the-following-snippet-def-fun-n-if-n-100-return-n-5-return-fun-fun-n11-print-fun-45-please-explaintoo-38636

What is the output of the following snippet? def fun(n): if (n > 100): return n - 5 return fun(fun(n+11)) print(fun(45))

Samuel G.


*

Recommended Textbooks

-
Computer Science and Information Technology

Computer Science and Information Technology

Trishna Knowledge Systems 2018 Edition
achievement 1,944 solutions
Introduction to Programming Using Python

Introduction to Programming Using Python

Y. Daniel Liang 1st Edition
achievement 1,992 solutions
Computer Science - An Overview

Computer Science - An Overview

Glenn Brookshear, Dennis Brylow 12th Edition
achievement 1,392 solutions

*

Transcript

-
00:01 We will not predict the output of this following program.
00:04 So let's go through each line of statement.
00:07 In the first line, it reads as let i equal to 1.
00:11 Notice that it starts with the line number 20.
00:15 So this is perfectly fine.
00:17 It's not necessary that it should always start with 20.
00:22 Even if it starts with 20, this is the first line of statement.
00:26 So let's take this.
00:28 We have i equal to 1...
Need help? Use Ace
Ace is your personal tutor. It breaks down any question with clear steps so you can learn.
Start Using Ace
Ace is your personal tutor for learning
Step-by-step explanations
Instant summaries
Summarize YouTube videos
Understand textbook images or PDFs
Study tools like quizzes and flashcards
Listen to your notes as a podcast
Continue solving this problem
Create a free account to:
  • View full step-by-step solution
  • Ask follow-up questions with Ace AI
  • Save progress and study later
Continue Free
Numerade

Get step-by-step video solution
from top educators

Continue with Clever
or



By creating an account, you agree to the Terms of Service and Privacy Policy
Already have an account? Log In

A free answer
just for you

Watch the video solution with this free unlock.

Numerade

Log in to watch this video
...and 100,000,000 more!


EMAIL

PASSWORD

OR
Continue with Clever