Python
#IMPORTANT! Instructions in each section are cumulative. The
later format specifiers should include previous formats
#withing each section
#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 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
#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
#Change the number's format to display one decimal place
#Display the number as formatted in the previous line
#Change the number's format to display AUS$ and a space to its
left
#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
#Change the number's format to display three decimal place
#Display the number as formatted in the previous line
#Change the number's format to display JPY and a space to its
left
#Display the number as formatted in the previous line
Section 1
var1 = 1234567
var1 = float(1234567)
print(var1)
p1 = "$%.2f" %(var1)
print(p1)
p2 = "%.4f" %(var1)
print(p2)
p3 = "NTD %f" %(var1)
print(p3)

Section 2
var2 = 30004000.6735
var2 = float(30004000.6735)
print(var2)
p1 = "HK$ %.3f" %(var2)
print(p1)
p2 = "HK$ %.1f" %(var2)
print(p2)
p3 = "AUS$ %f" %(var2)
print(p3)

Section 3
num = float(input("Enter a number: "))
print(num)
p1 = "$ %.2f" %(num)
print(p1)
p2 = "%.3f" %(num)
print(p2)
p3 = "JPY %f" %(num)
print(p3)

Python #IMPORTANT! Instructions in each section are cumulative. The later format specifiers should include previous formats...
For Python-3 I need help with First creating a text file named "items.txt" that has the following data in this order: Potatoes Tomatoes Carrots. Write a python program that 1. Puts this as the first line... import os 2. Creates an empty list 3. Defines main() function that performs the tasks listed below when called. 4. Put these two lines at the top of the main function... if os.path.exists("costlist.txt"): os.remove("costlist.txt") Note: This removes the "costlist.txt" file, if it exists. 5....
Written in python using puTTy!!
i'm having a lot of trouble with this, will upvote!
also here is the address.csv file
Name,Phone,Email,Year_of_Birth
Elizi Moe,5208534566,emoe@ncsu.edu,1978
Ma Ta,4345667345,mta@yahoo.com,1988
Diana Cheng,5203456789,dcheng@asu.edu,1970
ACTIVITY I
Implement in Python the Subscriber class modeled by the UML
diagram provided below. Save in a file called MyClasses.py
Subscriber
name: string
yearOfBirth: int
phone: string
email: string
getName()
getAge()
getPhone()
getEmail()
Write a test program that does the following:
Read the file addresses.csv.
For each record, create an object...
CT143 : Intro to C++ Lab 15: Array Practice Instructions Complete each of the C++ activities described below in a single source file Label each activity with its own heading using comments. Activities: 1) Favorite numbers a. Declare and initialize an array of 10 integers as a single statement using a name of your choice. b. Output the result of adding the 1st and 5th members of the array. C. Subtract the 4h member from 3 times the 10th member...
Use Python and need execution output Will give upvote! First Script - Working with Strings This script contains four parts. String Type Tests Ask the user for a string (test with "ABC123"). Use method isupper to test the string, print the result. Use method isdigit to test the string, print the result. Use method isalpha to test the string, print the result. Escape Characters within a string Use newline escape characters within a line of haiku Assign the text "Type,...
If you’re using Visual Studio Community 2015, as requested, the instructions below should be exact but minor discrepancies may require you to adjust. If you are attempting this assignment using another version of Visual Studio, you can expect differences in the look, feel, and/or step-by-step instructions below and you’ll have to determine the equivalent actions or operations for your version on your own. INTRODUCTION: In this assignment, you will develop some of the logic for, and then work with, the...
I need help writing python code with following instructions. You will write a program that reads a data file. The data file contains ticket IDs and ticket prices. Your job is to read these tickets (and prices). find minimum, maximum and average ticket prices and output a report file. The report file should look exactly (or better than) the one attached (output.txt). Input: A31 149.99 B31 49.99 A41 179.99 F31 169.99 A35 179.99 A44 169.99 open "input.txt" file using open()...
Step 1: design and code a program that uses a recursive method to convert a String of digit characters into an integer variable. For example, convert the character string “13531” to an integer with the value 13,531. Note that the comma is present only to distinguish the integer value from the character string (in quotes) . The program should be repetitive to allow the user to enter any number of number strings, convert them, display them, and sum them. When...
Write a C program to compute average grades for a course. The course records are in a single file and are organized according to the following format: Each line contains a student’s first name, then one space, then the student’s last name, then one space, then some number of quiz scores that, if they exist, are separated by one space. Each student will have zero to ten scores, and each score is an integer not greater than 100. Your program...
Please help program in python read all instructions
2.13 LAB*: Program: Cooking measurement converter Output each floating point value with two digits after the decimal point, which can be achieved as follows: print('{:.2f}'.format(your_value) (1) Prompt the user for the number of cups of lemon juice, water, and agave nectar needed to make lemonade. Prompt the user to specify the number of servings the recipe yields. Output the ingredients and serving size. (Submit for 2 points) Note: This zyLab outputs a...
%%Python Question%% get_min_payment() • Parameters ◦ the total amount of the mortgage (called the principal; should be a positive number) ◦ the annual interest rate (should be a float between 0 and 1) ◦ the term of the mortgage, in years (should be a positive integer; default value: 30) ◦ the number of payments per year (should be a positive integer; default value: 12) • Functionality ◦ Compute the minimum mortgage payment. Should use the formula A= Pr(1+r) n (1+r)...