Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python 3 #Try out floats and specifiers with the following activities #IMPORTANT! Instructions in each section are not cumulative. The later format specifiers will be

Python 3

#Try out floats and specifiers with the following activities #IMPORTANT! Instructions in each section are not cumulative. The later format specifiers will be applied to #the original number entered in each section after it is converted to a float. #use the specifier \"${:,.2f}\".format(identifier) to add a dollar sign to the left of a number and two decimal spaces

#Section 1 #Assign the number 1234567 to a variable #Convert the number to a float #Display the number #Note: Assign each of the following formatted outputs to new variable names #Now format the number with a dollar sign to its left and two decimal places using a format specifier #Display the number as formatted in the previous line #Change the number's format to display it with a dollar sign to its left and four decimal places #Display the number as formatted in the previous line #Change the number's format to display NTD and a space to its left and four decimal places #Display the number as formatted in the previous line

#Section 2 #Assign the number 30004000.6735 to a variable #Convert the number to a float #Display the number #Note: Assign each of the following formatted outputs to new variable names #Now format the number with HK$ and a space to its left and three decimal places using a format specifier #Display the number as formatted in the previous line #Now format the number with HK$ and a space to its left and one decimal place using a format specifier #Display the number as formatted in the previous line #Now format the number with AUS$ and a space to its left and one decimal place using a format specifier #Display the number as formatted in the previous line

#Section 3 #Ask the user for a number and assign it to a variable #Convert the number to a float #Display the number #Note: Assign each of the following formatted outputs to new variable names #Now format the number with $ and a space to its left and two decimal places using a format specifier #Display the number as formatted in the previous line #Now format the number with $ and a space to its left and three decimal places using a format specifier #Display the number as formatted in the previous line #Now format the number with JPY and a space to its left and three decimal places using a format specifier #Display the number as formatted in the previous line

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction to Wireless and Mobile Systems

Authors: Dharma P. Agrawal, Qing An Zeng

4th edition

1305087135, 978-1305087132, 9781305259621, 1305259629, 9781305537910 , 978-130508713

More Books

Students also viewed these Programming questions

Question

Distinguish between product substitutes and complements.

Answered: 1 week ago