import image def rotate(pic): '''Returns an image rotated 90 degrees''' pass #You can leave this or remove it #Your code here to rotate the image #Hint: you'll have to create an empty image that swaps the #width and height of pic - it will have the same number of #columns as pic has rows and the same number of rows as #pic has columns. Then copy the pixels from pic into the #rotated positions in the empty image. def main():

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter6: Arrays
Section: Chapter Questions
Problem 5GZ
icon
Related questions
Question
1 import image
2
3 def rotate(pic):
'''Returns an image rotated 90 degrees'
pass #You can leave this or remove it
#Your code here to rotate the image
#Hint: you'll have to create an empty image that swaps the
#width and height of pic - it will have the same number of
#columns as pic has rows and the same number of rows as
#pic has columns. Then copy the pixels from pic into the
#rotated positions in the empty image.
4
6.
7
8
10
11
12
13 def main():
Transcribed Image Text:1 import image 2 3 def rotate(pic): '''Returns an image rotated 90 degrees' pass #You can leave this or remove it #Your code here to rotate the image #Hint: you'll have to create an empty image that swaps the #width and height of pic - it will have the same number of #columns as pic has rows and the same number of rows as #pic has columns. Then copy the pixels from pic into the #rotated positions in the empty image. 4 6. 7 8 10 11 12 13 def main():
13 def main():
14
'''Controls the program'
fname = "https://runestone.academy/runestone/static/instructorguide/_static
/arch.jpg"
img
15
%3D
16
image. Image(fname)
img.getWidth()
17
18
width
%3D
height = img.getHeight()
win = image. ImageWin(height, width)
rotate(img)
img.draw(win)
19
20
21
22
23
24 main() #Run the program
25
Transcribed Image Text:13 def main(): 14 '''Controls the program' fname = "https://runestone.academy/runestone/static/instructorguide/_static /arch.jpg" img 15 %3D 16 image. Image(fname) img.getWidth() 17 18 width %3D height = img.getHeight() win = image. ImageWin(height, width) rotate(img) img.draw(win) 19 20 21 22 23 24 main() #Run the program 25
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage