1 / 4

What is x? x = 12 % 5 5 12 0 1 2 3 4

What is x? x = 12 % 5 5 12 0 1 2 3 4. Here’s a program: text = “mongoose” print text[1] What does Python print? m o mongoose ongoose. Here’s a program: text = “mongoose” print text [-1] What does Python print? m o e em (Python gives an error).

gavan
Download Presentation

What is x? x = 12 % 5 5 12 0 1 2 3 4

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. What is x? x = 12 % 5 • 5 • 12 • 0 • 1 • 2 • 3 • 4

  2. Here’s a program: text = “mongoose” print text[1] What does Python print? • m • o • mongoose • ongoose

  3. Here’s a program: text = “mongoose” print text[-1] What does Python print? • m • o • e • em • (Python gives an error)

  4. Here’s a program: text = “mongoose” for item in text: print item, What does Python print? • mongoose • m o n g o o s e • m • m o • (Python gives an error)

More Related