Question

PLEASE DO THIS IN PYTHON!! 1.) Goal: Become familiar with The Python Interpreter and IDLE. Use...

PLEASE DO THIS IN PYTHON!!

1.) Goal: Become familiar with The Python Interpreter and IDLE.

Use IDLE to type, compile, and run (execute) the following programs.

Name and save each program using the class name. Save all programs in one folder, call it Lab1-Practices.

Save all programs for future reference as they illustrate some programming features and syntax that you may use in other labs and assignments.

================================== Program CountDown.py ===================================

# Program CountDown.py

# Demonstrate how to print to console/screen.

# Prints two lines of output representing a rocket countdown.

   

print ("Three...", end =" ")# end = “ “ prevents print from creating a new line

print ("Two...", end =" ") # end = “ “ prevents print from creating a new line

print ("One...", end =" ") # end = “ “ prevents print from creating a new line

print ("Zero...", end =" ") # end = “ “ prevents print from creating a new line

print ("Liftoff!")

print ("Houston, we have a problem.")

================================== Program Addition.py ====================================

# Program Addition.py

# Demonstrate the difference between the addition and string concatenation operators.

# Concatenates and adds two numbers and prints the results.
      
print ("24 and 45 concatenated: ", 24, 45)
print ("24 and 45 added: ", (24 + 45))

==================================== Program Echo.py ======================================

# Program Echo.py

# Demonstrate reading a string from the user.

# Reads a character string from the user and prints it.

message = input("Enter a line of text: ")

print ('You entered: /', message, '/')

=================================== Program GasMileage.py =================================

# Program GasMileage.py

# Calculates fuel efficiency based on values entered by the user.   

miles = int(input ("Enter the number of miles: ") )

gallons = int(input("Enter the gallons of fuel used: ") )

mpg = miles / gallons

print ("Miles Per Gallon: ", mpg)

==================================== Program Facts.py =====================================

# Program Facts.py

# Demonstrate string concatenation operator conversion of an integer to a string.

# Prints various facts.

   

# Strings can be concatenated into one long string

print ("We present the following facts for your ", " extracurricular edification:")       

     

# A string can contain numeric digits

print ("Letters in the Hawaiian alphabet: 12")      

     

# A numeric value can be concatenated to a string

print ("Dialing code for Antarctica: ", 672)

print ("Year in which Leonardo da Vinci invented ", "the parachute: ", 1515)

print ("Speed of ketchup: ", 40 ," km per year")     

0 0
Add a comment Improve this question Transcribed image text
Answer #1

The answers for your question given below

CountDown.py

# Program CountDown.py
# Demonstrate how to print to console/screen.
# Prints two lines of output representing a rocket countdown.
print ("Three...", end=" ")# end = “ “ prevents print from creating a new line
print ("Two...", end=" ") # end = “ “ prevents print from creating a new line
print ("One...", end=" ") # end = “ “ prevents print from creating a new line
print ("Zero...", end=" ") # end = “ “ prevents print from creating a new line
print ("Liftoff!")
print ("Houston, we have a problem.")

Output

Addition.py

# Program Addition.py
# Demonstrate the difference between the addition and string concatenation operators.
# Concatenates and adds two numbers and prints the results.
print ("24 and 45 concatenated: ", 24, 45)
print ("24 and 45 added: ", (24 + 45))

Output

Echo.py

# Program Echo.py
# Demonstrate reading a string from the user.
# Reads a character string from the user and prints it.
message = input("Enter a line of text: ")
print ('You entered: /', message, '/')

Output

GasMileage.py

# Program GasMileage.py
# Calculates fuel efficiency based on values entered by the user.
miles = int(input ("Enter the number of miles: ") )
gallons = int(input("Enter the gallons of fuel used: ") )
mpg = miles / gallons #calculate fuel efficiency
print ("Miles Per Gallon: ", mpg)

Output

Facts.py

# Program Facts.py
# Demonstrate string concatenation operator conversion of an integer to a string.
# Prints various facts.
# Strings can be concatenated into one long string
print ("We present the following facts for your ", " extracurricular edification:")     
# A string can contain numeric digits
print ("Letters in the Hawaiian alphabet: 12")    
# A numeric value can be concatenated to a string
print ("Dialing code for Antarctica: ", 672)
print ("Year in which Leonardo da Vinci invented ", "the parachute: ", 1515)
print ("Speed of ketchup: ", 40 ," km per year")    

Output

Add a comment
Know the answer?
Add Answer to:
PLEASE DO THIS IN PYTHON!! 1.) Goal: Become familiar with The Python Interpreter and IDLE. Use...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • You previously wrote a program that calculates and displays: Miles driven Miles per gallon Kilometers driven...

    You previously wrote a program that calculates and displays: Miles driven Miles per gallon Kilometers driven Liters of fuel consumed Kilometers per liter Messages commenting on a vehicle's fuel efficiency And also validates input Now we'll make a somewhat major change. We'll remove the code for obtaining input from a user and replace it with hardcoded data stored in lists. Because the data is hardcoded, the program will no longer need the code for validating input. So, you may remove...

  • Drivers are concerned with the mileage their automobiles get. One driver has kept track of several...

    Drivers are concerned with the mileage their automobiles get. One driver has kept track of several tankfuls of gasoline by recording the miles driven and gallons used for each tankful. Develop a C# app that will input the miles driven and gallons used (both as integers) for each tankful. The app should calculate and display the miles per gallon obtained for each tankful and display the combined miles per gallon obtained for all tankfuls up to this point. All averaging...

  • 23.4 Project 4: Using Pandas for data analysis and practice with error handling Python Please! 23.4...

    23.4 Project 4: Using Pandas for data analysis and practice with error handling Python Please! 23.4 PROJECT 4: Using Pandas for data analysis and practice with error handling Overview In this project, you will use the Pandas module to analyze some data about some 20th century car models, country of origin, miles per gallon, model year, etc. Provided Input Files An input file with nearly 200 rows of data about automobiles. The input file has the following format (the same...

  • Create a new Python program in IDLE, and save it as lab8.py.(Again, I recommend saving lab...

    Create a new Python program in IDLE, and save it as lab8.py.(Again, I recommend saving lab progranms Your Python program will do the following: Create an empty list . Use a for loop to ask the user for 10 numbers. Add each number to your list using the append metha . Use another for loop to print the list in reverse order, one per line . Use a while loop to count how many positive numbers are in the list...

  • I need help with this python programming exercise, please! thanks in advance Create a Python script...

    I need help with this python programming exercise, please! thanks in advance Create a Python script file called hw4.py. Add your name at the top as a comment, along with the class name and date. Both exercises should be in this file, with a comment before each of them to mark it. Ex. 1. Write a program that inputs an integer number from the user, then prints a letter "O" in ASCII art using a width of 5 and the...

  • Python 3 coding with AWS/Ide. Objective: The purpose of this lab is for you to become familiar with Python’s built-in te...

    Python 3 coding with AWS/Ide. Objective: The purpose of this lab is for you to become familiar with Python’s built-in text container -- class str-- and lists containing multiple strings. One of the advantages of the str class is that, to the programmer, strings in your code may be treated in a manner that is similar to how numbers are treated. Just like ints, floats, a string object (i.e., variable) may be initialized with a literal value or the contents...

  • 3. Write Python statements that will do the following: a) Input a string from the user....

    3. Write Python statements that will do the following: a) Input a string from the user. *** Print meaningful messages along with your output.* b) Print the length of the String. Example input: The sky is blue. Correct output: The length of the string is 16 Incorrect output: 16 c) Print the first character of the string. d) Print the last character of the string. 4. Save the program. Double-check the left edge for syntax errors or warning symbols before...

  • This program should be run on Visual Studio. Please use printf and scanf as input and output. Tha...

    This program should be run on Visual Studio. Please use printf and scanf as input and output. Thank you 6.12 Lab Exercise Ch.6b: C-string functions Create and debug this program in Visual Studio. Name your code Source.c and upload for testing by zyLabs You will write 2 functions which resemble functions in the cstring library. But they will be your own versions 1. int cstrcat(char dstDchar src) which concatenates the char array srcl to char array dstD, and returns the...

  • For Python 3.8! Copy and paste the following bolded code into IDLE: movies = [[1939, 'Gone...

    For Python 3.8! Copy and paste the following bolded code into IDLE: movies = [[1939, 'Gone with the Wind', 'drama'],           [1943, 'Casablanca', 'drama'],           [1965, 'The Sound of Music', 'musical'],           [1969, 'Midnight Cowboy', 'drama'],           [1972, 'The Godfather', 'drama'],           [1973, 'The Sting', 'comedy'],           [1977, 'Annie Hall', 'comedy'],           [1982, 'Ghandi', 'historical'],           [1986, 'Platoon', 'action'],           [1990, 'Dances with Wolves', 'western'],           [1992, 'Unforgiven', 'western'],           [1994, 'Forrest Gump', 'comedy'],           [1995, 'Braveheart', 'historical'],           [1997,...

  • 1. Write a program that prompts the user to enter three integers and display the integers...

    1. Write a program that prompts the user to enter three integers and display the integers in non-decreasing order. You can assume that all numbers are valid. For example: Input Result 140 -5 10 Enter a number: Enter a number: Enter a number: -5, 10, 140 import java.util.Scanner; public class Lab01 { public static void main(String[] args) { Scanner input = new Scanner(System.in);    } } ---------------------------------------------------------------------------------------------------------------------------- 2. Write a program that repeatedly prompts the user for integer values from...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT