In [42]: 1 #4. Use the correct comparison operator to check if s is not equal to 10. 2 3 if 5 5 *** Out [42]: "\nif s 10:\n print("s and 10 is not equal")\n" In [43]: 1 # 5. Use the correct Logical operator to check if at least one of two statements is 2 *** In [44]: 10: print("5 and 10 is not equal") 3 1 5 10 4 $*** out [43]: "\nif 5 out [44]: In [45]: 4 = 4: print("At least one of the statements is true") In [46]: 104 4:\n print("At least one of the statements is true")\n" 16. Print the second item in the fruits List. 2 *** 3 fruits ["apple", "banana", "cherry"] 4 print( www \nfruits ["apple", "banana", "cherry"]\nprint()\n" 17. Change the value from "apple" to "Riwi", in the fruits List. www 2 3 fruits ["apple", "banana", "cherry"] $*** 6 out [45]: \nfruits ["apple", "banana", "cherry"]\n_ 18. Use the append method to add "orange" to the fruits List. 3 fruits ["apple", "banana", "cherry"] 4 out [46]: \nfruits ["apple", "banana", "cherry"]\n_ In [47]: 19. Use the insert method to add "Lemon" as the second item in the fruits List. 2 *** 3 fruits = ["apple", "banana", "cherry"] 4 "lemon") S*** out [47]: "\nfruits ["apple", "banana", "cherry"]\n _\n" Out [48]: \nfruits ["apple", "banana", "cherry"]\n, _"lemon")\n" In [48]: 1 #10. Use the remove method to remove "banana" from the fruits List. 3 fruits ["apple", "banana", "cherry"] S \n"

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
icon
Concept explainers
Question
In [42]: 1 # 4. Use the correct comparison operator to check if 5 is not equal to 10.
2
3 if 5
In [43]:
out [42]: \nif 5
In [44]:
5
In [45]:
10:
print("5 and 10 is not equal")
www
10:\n print("5 and 10 is not equal")\n"
1 # 5. Use the correct Logical operator to check if at least one of two statements is
2
3 1 5 10
4
5
out [43]: '\nif 5 == 104 == 4:\n print("At least one of the statements is true")\n"
In [47]:
In [48]:
44:
print("At least one of the statements is true")
www
out [44]: \nfruits = ["apple", "banana", "cherry"]\nprint(____)\n"
1 # 6. Print the second item in the fruits List.
www
2
3 fruits ["apple", "banana", "cherry"]
4 print (___)
5
5
6
Out [45]: \nfruits ["apple", "banana", "cherry"]\n_
In [46]:
1 # 7. Change the value from "apple" to "kiwi", in the fruits List.
2
3 fruits ["apple", "banana", "cherry"]
out [46]: \nfruits = ["apple", "banana", "cherry"]\n_
1 # 8. Use the append method to add "orange" to the fruits List.
2
3 fruits = ["apple", "banana", "cherry"]
4
5
5
3 fruits = ["apple", "banana", "cherry"]
4
_"lemon")
5
out [47]: \nfruits ["apple", "banana", "cherry"]\n
1 # 9. Use the insert method to add "Lemon" as the second item in the fruits List.
2
www
.\n"
\n'
Out [48]: '\nfruits = ["apple", "banana", "cherry"]\n_
1 #10. Use the remove method to remove "banana" from the fruits List.
2
3 fruits = ["apple", "banana", "cherry"]
4
"lemon")\n"
\n'
Transcribed Image Text:In [42]: 1 # 4. Use the correct comparison operator to check if 5 is not equal to 10. 2 3 if 5 In [43]: out [42]: \nif 5 In [44]: 5 In [45]: 10: print("5 and 10 is not equal") www 10:\n print("5 and 10 is not equal")\n" 1 # 5. Use the correct Logical operator to check if at least one of two statements is 2 3 1 5 10 4 5 out [43]: '\nif 5 == 104 == 4:\n print("At least one of the statements is true")\n" In [47]: In [48]: 44: print("At least one of the statements is true") www out [44]: \nfruits = ["apple", "banana", "cherry"]\nprint(____)\n" 1 # 6. Print the second item in the fruits List. www 2 3 fruits ["apple", "banana", "cherry"] 4 print (___) 5 5 6 Out [45]: \nfruits ["apple", "banana", "cherry"]\n_ In [46]: 1 # 7. Change the value from "apple" to "kiwi", in the fruits List. 2 3 fruits ["apple", "banana", "cherry"] out [46]: \nfruits = ["apple", "banana", "cherry"]\n_ 1 # 8. Use the append method to add "orange" to the fruits List. 2 3 fruits = ["apple", "banana", "cherry"] 4 5 5 3 fruits = ["apple", "banana", "cherry"] 4 _"lemon") 5 out [47]: \nfruits ["apple", "banana", "cherry"]\n 1 # 9. Use the insert method to add "Lemon" as the second item in the fruits List. 2 www .\n" \n' Out [48]: '\nfruits = ["apple", "banana", "cherry"]\n_ 1 #10. Use the remove method to remove "banana" from the fruits List. 2 3 fruits = ["apple", "banana", "cherry"] 4 "lemon")\n" \n'
Exercise 3.1:
In [39]: 1 # 1. Multiply 10 with 5, and print the result.
2
In [40]: 1 # 2. Divide 10 by 2, and print the result.
2
In [41]:
1 # 3. Use the correct membership operator to check if "apple" is present in the frui
2
3 fruits ["apple", "banana"]
4 if "apple" fruits:
5
6
7
-
print("Yes, apple is a fruit!")
print ()
Transcribed Image Text:Exercise 3.1: In [39]: 1 # 1. Multiply 10 with 5, and print the result. 2 In [40]: 1 # 2. Divide 10 by 2, and print the result. 2 In [41]: 1 # 3. Use the correct membership operator to check if "apple" is present in the frui 2 3 fruits ["apple", "banana"] 4 if "apple" fruits: 5 6 7 - print("Yes, apple is a fruit!") print ()
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Control Structure
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