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():
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():
Chapter8: Arrays
Section: Chapter Questions
Problem 9PE
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():](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Ff963c6fa-bb85-448b-8097-6c143e54c580%2F604da9c0-d5e5-410b-a7e7-3e196883b8e7%2Fa120vqr_processed.png&w=3840&q=75)
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](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Ff963c6fa-bb85-448b-8097-6c143e54c580%2F604da9c0-d5e5-410b-a7e7-3e196883b8e7%2Fgxs4hb_processed.png&w=3840&q=75)
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
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Knowledge Booster
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.Recommended textbooks for you
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage