1. import random Animals= ['dog', 'Cat', 'Lions', 'cow', 'elephant' ] random.choice (pets) 2. Animals.sort (reverse=True) 3. Animals.remove('Cat') 4. Animals.reverse()

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
2:00 AM Fri Oct 21
5 of 6
1.
2.
import random
Animals= ['dog', 'Cat', 'Lions', 'cow', 'elephant' ]
random.choice (pets)
3.
Animals.sort (reverse=True)
learn-us-east-1-prod-fleet02-xythos.content.blackboardcdn.com - Private
4.
Animals.remove('Cat')
Run the following codes and find the outputs:
5.
Animals.reverse()
import random
Set your own Example.
6.
import copy
letter = ['m', 'n', 'o', 'p']
id (letter)
7.
9.
Animals = ['cat', 'bat', 'rat', 'elephant']
Animals [1]
= 'rabbit'
Animals
8. interactive shell
word=beautiful
birthdays
while True:
Section 2
=
==
{'Alice': 'Apr 1', 'Bob': 'Dec 12', 'Carol': 'Mar 4'}
print('Enter a name: (blank to quit)')
name input ()
if name
break
if name in birthdays:
print (birthdays [name] + is the birthday of '
: ܝ ܝ
1
+ name,
65%
Transcribed Image Text:2:00 AM Fri Oct 21 5 of 6 1. 2. import random Animals= ['dog', 'Cat', 'Lions', 'cow', 'elephant' ] random.choice (pets) 3. Animals.sort (reverse=True) learn-us-east-1-prod-fleet02-xythos.content.blackboardcdn.com - Private 4. Animals.remove('Cat') Run the following codes and find the outputs: 5. Animals.reverse() import random Set your own Example. 6. import copy letter = ['m', 'n', 'o', 'p'] id (letter) 7. 9. Animals = ['cat', 'bat', 'rat', 'elephant'] Animals [1] = 'rabbit' Animals 8. interactive shell word=beautiful birthdays while True: Section 2 = == {'Alice': 'Apr 1', 'Bob': 'Dec 12', 'Carol': 'Mar 4'} print('Enter a name: (blank to quit)') name input () if name break if name in birthdays: print (birthdays [name] + is the birthday of ' : ܝ ܝ 1 + name, 65%
2:00 AM Fri Oct 21
B C Sign Up [C] 2: Which of t... C problem 3 w... Bb Schedule &...
5 of 6
AA1-prod-fleet02-xythos.content.blackboardcdn.com > C
Animals = ['cat', 'bat', 'rat', 'elephant']
Animals [1] = 'rabbit'
Animals
8. interactive shell
word=beautiful
9.
birthdays
while True:
=
if name ==
print('Enter a name: (blank to quit)')
name input ()
{'Alice': 'Apr 1', 'Bob': 'Dec 12', 'Carol': 'Mar 4'}
: ܝ ܝ
break
if name in birthdays:
print (birthdays [name] + ' is the birthday of ' + name)
else:
print('I do not have birthday information for ' + name)
print('What is their birthday?')
bday input ()
birthdays [name]
=
bday
print('Birthday database updated.')
10.
spam =
for v in spam. values():
print (v)
{'color': 'red', 'age': 42}
1
for k in spam.keys ():
print (k)
for i in spam.items():
print (i)
X learn-us-eas...
65%
+88
-us-eas... ork H...
Transcribed Image Text:2:00 AM Fri Oct 21 B C Sign Up [C] 2: Which of t... C problem 3 w... Bb Schedule &... 5 of 6 AA1-prod-fleet02-xythos.content.blackboardcdn.com > C Animals = ['cat', 'bat', 'rat', 'elephant'] Animals [1] = 'rabbit' Animals 8. interactive shell word=beautiful 9. birthdays while True: = if name == print('Enter a name: (blank to quit)') name input () {'Alice': 'Apr 1', 'Bob': 'Dec 12', 'Carol': 'Mar 4'} : ܝ ܝ break if name in birthdays: print (birthdays [name] + ' is the birthday of ' + name) else: print('I do not have birthday information for ' + name) print('What is their birthday?') bday input () birthdays [name] = bday print('Birthday database updated.') 10. spam = for v in spam. values(): print (v) {'color': 'red', 'age': 42} 1 for k in spam.keys (): print (k) for i in spam.items(): print (i) X learn-us-eas... 65% +88 -us-eas... ork H...
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

I need to do question 5 and every question after that. Please help. I already know 1-4.

2:00 AM Fri Oct 21
B C Sign Up [C] 2: Which of t...
5 of 6
AA1-prod-fleet02-xythos.content.blackboardcdn.com
8. interactive shell
word=beautiful
9.
Animals = ['cat', 'bat', 'rat', 'elephant']
Animals [1] = 'rabbit'
Animals
birthdays
while True:
=
: ܝ ܝ
print('Enter a name: (blank to quit)')
name input ()
if name ==
{'Alice': 'Apr 1', 'Bob': 'Dec 12', 'Carol': 'Mar 4'}
problem 3 w... Bb Schedule &...
break
if name in birthdays:
print (birthdays [name] + ' is the birthday of ' + name)
...
=
else:
print('I do not have birthday information for ' + name)
print('What is their birthday?')
bday input ()
birthdays [name]
bday
print('Birthday database updated.')
10.
spam =
for v in spam. values():
print (v)
{'color': 'red', 'age': 42}
for k in spam.keys ():
print (k)
1
for i in spam.items():
print (i)
X
learn-us-eas... 1-us-eas...
65%
+88
ork H...
Transcribed Image Text:2:00 AM Fri Oct 21 B C Sign Up [C] 2: Which of t... 5 of 6 AA1-prod-fleet02-xythos.content.blackboardcdn.com 8. interactive shell word=beautiful 9. Animals = ['cat', 'bat', 'rat', 'elephant'] Animals [1] = 'rabbit' Animals birthdays while True: = : ܝ ܝ print('Enter a name: (blank to quit)') name input () if name == {'Alice': 'Apr 1', 'Bob': 'Dec 12', 'Carol': 'Mar 4'} problem 3 w... Bb Schedule &... break if name in birthdays: print (birthdays [name] + ' is the birthday of ' + name) ... = else: print('I do not have birthday information for ' + name) print('What is their birthday?') bday input () birthdays [name] bday print('Birthday database updated.') 10. spam = for v in spam. values(): print (v) {'color': 'red', 'age': 42} for k in spam.keys (): print (k) 1 for i in spam.items(): print (i) X learn-us-eas... 1-us-eas... 65% +88 ork H...
2:00 AM Fri Oct 21
5 of 6
1.
2.
3.
import random
Animals= ['dog', 'Cat', 'Lions', 'cow', 'elephant' ]
random.choice (pets)
Animals.sort (reverse=True)
4.
learn-us-east-1-prod-fleet02-xythos.content.blackboardcdn.com - Private
Animals.remove('Cat')
5.
Run the following codes and find the outputs:
Animals.reverse()
import random
Set your own Example.
6.
import copy
letter = ['m', 'n', 'o', 'p']
id(letter)
9.
8. interactive shell
word=beautiful
7.
Animals = ['cat', 'bat', 'rat', 'elephant']
Animals [1]
= 'rabbit'
Animals
●●●
birthdays
while True:
Section 2
=
==
{'Alice': 'Apr 1', 'Bob': 'Dec 12', 'Carol': 'Mar 4'}
print('Enter a name: (blank to quit)')
name input ()
if name
: ܝ ܝ
break
if name in birthdays:
print (birthdays [name] + is the birthday of '
1
+ name,
65%
Transcribed Image Text:2:00 AM Fri Oct 21 5 of 6 1. 2. 3. import random Animals= ['dog', 'Cat', 'Lions', 'cow', 'elephant' ] random.choice (pets) Animals.sort (reverse=True) 4. learn-us-east-1-prod-fleet02-xythos.content.blackboardcdn.com - Private Animals.remove('Cat') 5. Run the following codes and find the outputs: Animals.reverse() import random Set your own Example. 6. import copy letter = ['m', 'n', 'o', 'p'] id(letter) 9. 8. interactive shell word=beautiful 7. Animals = ['cat', 'bat', 'rat', 'elephant'] Animals [1] = 'rabbit' Animals ●●● birthdays while True: Section 2 = == {'Alice': 'Apr 1', 'Bob': 'Dec 12', 'Carol': 'Mar 4'} print('Enter a name: (blank to quit)') name input () if name : ܝ ܝ break if name in birthdays: print (birthdays [name] + is the birthday of ' 1 + name, 65%
Solution
Bartleby Expert
SEE SOLUTION
Knowledge Booster
Map
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
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education