Day: September 1, 2023

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? […]

September 1, 2023

Python Variable Exercises

Which function in Python is used to ask the user to enter information? input() print() Submit Get an email address from your user and print it. email_address = “”() print(email_address) print input Submit Add a prompt message to the input() function. email_address = input(”) print(email_address) Please enter your email address: ‘Please enter your email address:’ […]

September 1, 2023

Python Variable Exercises

Select the variable name that is more descriptive and meaningful. “” = ‘C:\main.py’ p path Submit Which variable name is more descriptive for holding a total budget value? total_budget tb Submit Correct this code. product”category = ‘electronics’ _ + Submit What’s wrong with this variable? product category = ‘electronics’ There is no wrong in the […]