Tag: Data Types

September 23, 2023

Java Data Types Exercises – Part 4

What is the output of this code? class Main { public static void main(String[] args) { int numberOfAttendance = 10; int seats = 18; boolean areSeatsEnough = seats >= numberOfAttendance; System.out.println(“Are seats enough? ” + areSeatsEnough); } } Are seats enough? true Are seats enough? false Submit This code checks if a product is in […]

September 23, 2023

Java Data Types Exercises – Part 2

Choose the proper data type. class Main { public static void main(String[] args) { “” result = Math.max(30, 33); System.out.println(result); } } int String boolean Submit Choose the proper data type. class Main { public static void main(String[] args) { “” result = Math.max(30.2, 33.1); System.out.println(result); } } double long int Submit Choose the proper […]

September 1, 2023

Python Data Types Exercises

What is the output of the round() function? market_share = 12.03298 rounded_market_share = round(market_share, 2) print(rounded_market_share) 12.2 12.03 Submit How many arguments does the round function take in the given code snippet? market_share = 12.03298 rounded_market_share = round(market_share, 2) print(rounded_market_share) Two arguments including market_share and 2 12.03298 Submit Find the lowest price. product_prices = [27.99, […]

September 1, 2023

Python Data Types Exercises

What is the output of this code? hashtag = “#Python” hashtag_length = len(hashtag) print(hashtag_length) 6 7 Submit What is the output of this code? phone_number = ‘555-1234′ phone_number_length = len(phone_number) print(phone_number_length) 8 We can’t use the len function on this variable Submit When using the len() function in Python, does it count spaces as well? […]