Python Variables Worksheet
Print | Save
Output: Your Goal
You will write a program to store a message in two variables, then print that message.

Part 1: Plan and Write the Pseudocode
Write an algorithm using pseudocode that someone else can follow. Choose one of the following options:
Decide on the message you would like to display to the screen. Some ideas include:
Your favorite book title or TV show and why you like it
A few sentences sharing information about you
Your favorite sport and team or athlete
Use two variables to store your message.
Insert your pseudocode here:






Part 2: Code the Program
Use the following guidelines to code your program.
Use the Python IDLE to write your program.
Using comments, type a heading that includes your name, today’s date, and a short description.
Set up your def main(): statement. (Don’t forget the parentheses and colon.)
Use at least two variables and two print statements to display your message to the screen.
Conclude the program with the main() statement.
Follow the Python style conventions regarding indentation in your program.
Run your program to ensure it is working properly. Fix any errors you may observe.
Example of expected output: The output below is an example of a “Favorite TV Show” message. Your specific results will vary depending on the choices you make about your message.
Output
My favorite TV show is MythBusters.
I like it because I learn a lot and they do crazy experiments.

When you've completed writing your program code, save your work by selecting 'Save' in the Python IDLE. When you submit your assignment, you will attach this Python file separately.

Part 3: Post Mortem Review (PMR)
Write two to three sentence responses to all the questions in the PMR chart.
Review Question
Response
What was the purpose of your program?

How could your program be useful in the real world?

What is a problem you ran into, and how did you fix it?

Describe one thing you would do differently the next time you write a program.



Part 4: Save Your Work
Don't forget to save this worksheet. You will submit it for your assessment.
Print | Save

Answers

Answer 1

Answer:

Pseudocode:

define func main

accept two parameters

create two variables from those parameters

v1 = title

v2=message

print v1, v2

returns None

call the func including the two arguments

Code:

def main(p1, p2):

""" this is a docstring, the function accepts two parameters p1 and p2 and prints them out"""

____title = p1

____message = p2

____print(title)

____print(message)

main()

Reminder

this didnot include the comment you are to add about your name, date and details

-- comments are placed after a pound sign (#)

also "____" the dashes behind the variables are not indentation just empasising them, as they are done with either by

Tab Button - pressed onceSpace Bar - pressed four times

NEVER MIX THEM CHOOSE AN INDENTATION STYLE AND STICK TO IT

Finally the call function doesn't have a colon called as a nomal object, just as the print funtion also you may include the dicstring if neccessary.

DONT FORGET THE REVIEW QUESTIONS


Related Questions

• Describe why you may have traveled to the same place many times. Why would this happen in nature?

Answers

I have traveled to the same place many times because I enjoy going there and I am very familiar with it. So in nature many animals will continue to go to the same place because of the same reasons they might know there is a supply of food there or that there is water.

Write a function that takes the name of a file with a .csv extension (a comma-separated value file), and writes a new file that is equivalent (same name and same data) but with a .tsv extension (a tab-separated value file: like a CSV but with tabs instead of commas separating the elements of the file). Note: the character used to represent a tab is ‘\t’.

Answers

Answer:

import pandas as pd

def convert_to_tsv( csv_filename ):

   df = pd.read_csv("csv_file")

   df.to_csv("csv_filename.tsv", sep='\t')

Explanation:

The python program uses the pandas' module to read in the csv file in the function "convert_to_tsv". The file is saved as a tsv file with the pandas to_csv method and the " sep= '\t' " attribute.

Microsoft Word, Google Chrome, and Windows Media Player are examples of

Answers

Answer:

They are all examples of software.

A battery is connected to a light bulb in a circuit. There is a current of 2 A in the light bulb. The voltage of the battery is 1.5 V. What is the resistance of the light bulb?

Answers

Answer:

The current in a circuit is directly proportional to the electric potential difference impressed across its ends and inversely proportional to the total resistance offered by the external circuit. The greater the battery voltage, the greater the current.

Explanation:

Explain two options you have in order to abide by the move over law??? PLEASE HELP ME ASAP!! ​

Answers

Answer:

you can either move over if on an interstate into a different lane safely. if there is only one lane you must reduce your speed

When and how should resources be invested to close gaps between those who do and don’t use the Internet?

Answers

Answer:

To minimize the technological gap is necessary and not so hard.

Explanation:

The first form of solving it is to minimize the need to use the internet at home, so that users could save the data in some programs which could use afterward if needed, without the internet.

Access to the documents, books, and folders without the need for the internet would be the perfect solution.

The Internet has to be accessible in school so that the students who don’t have it at home could use the most of it in school. Also, the internet connection should be available in the spots around schools, cafes, libraries during the whole day.

Make the internet affordable for everyone.

Read this passage from The Phantom Tollbooth. There was once a boy named Milo who didn't know what to do with himself--not just sometimes, but always. When he was in school he longed to be out, and when he was out he longed to be in. On the way he thought about coming home, and coming home he thought about going. Wherever he was he wished he were somewhere else, and when he got there he wondered why he'd bothered. Nothing really interested him--least of all the things that should have. The most likely reason the author begins this fantasy with a realistic element is to make the text more amusing. exciting. believable. interesting.

Answers

Answer:

I think its believable

Explanation:

^^

I think its believable

why make people act meaner online the. in person ​

Answers

Because they are scared to say something in real life. Behind a screen they are protected

difference between logical errors and syntax errors​

Answers

Since computer programs must follow strict syntax to compile correctly, any aspects of the code that do not conform to the syntax of the programming language will produce a syntax error. A logic error (or logical error) is a 'bug' or mistake in a program's source code that results in incorrect or unexpected behaviour.

How do I write my name in binary code?

Answers

Answer:

qUE

wHAT CODE

Explanation:

Documentary photographers strive to produce what type of image?
А.
Edited
B.
True
C.
Colorful
D.
Blurred

Answers

I’m pretty sure that the answer is B

Answer:

B. :)

Explanation:

match the following
Group A Group B
Hub Connect different types of networks of same protocol
Router Twisted Pair cable
BNC terminator Transmission channel for WLAN
RJ 45 Connecting device within a network
Coaxial cable

Answers

Answer:

i can't understand this question.please repost it by. making it clear.

Which of the following would be done outside of a control room?


programming a teleprompter

cueing camera operators

switching between multiple cameras

uploading camera footage on location

Answers

Answer:

a

Explanation:

Answer:

a

Explanation:

~Föllòw gixannaa on tìktòk and then comment done~
(I will give brainliest answer if you tell me your user)

Answers

Answer:

my user is shut.upnow

Explanation:

lol

Answer:

I don't have tik tock sorry if I did I would have followed u

Explanation:

:D

What is wrong in this python code import turtle bot = turtle.Turtle step = (50) turnAngle = (90) bot.Color("blue") bot.Begin_fill() bot.Forward(step) bot.Right(turnAngle) bot.Forward(step) bot.Right(turnAngle) bot.Forward(step) bot.Right(turnAngle) bot.Forward(step) bot.Right(turnAngle) bot.End_fill()

Answers

Answer:

The "Turtle" is a method and should be declared with parenthesis and every other method in the code (except the Turtle() ) should begin with lowercase letters like right, forward and begin_fill. The python file should not be saved as turtle.py to avoid import error.

Explanation:

The python turtle module is a graphical programming package created to introduce programming to children. It has several classes and methods to manipulate objects on the screen.

import turtle  

bot = turtle.Turtle()  

step =(50)  

turnAngle =90  

bot.color("blue")  

bot.begin_fill()  

bot.forward(step)  

bot.right(turnAngle)  

bot.forward(step)  

bot.right(turnAngle)  

bot.forward(step)  

bot.right(turnAngle)  

bot.forward(step)  

bot.right(turnAngle)  

bot.end_fill()

how many ones dose it take to get 9 tens

Answers

It takes 90 ones to get 9 tens
The answer would be 90:)

Explanation: there are 10 ones in one 10 so if you multiply 10 times 9 it’s 90

A computer that provides special services to client computers on demand.

Answers

Answer:

A server?

Explanation:

I feel like this would be the answer but if it is multiple choice, reply with the possible answers. Hope this helps!

Justify the following statement: “Some Americans’ sedentary lifestyles contribute to their poor health.”

Answers

It is essential that people are active in their lives to fulfill that basic biological need. This will allow blood flow to increase, which is beneficial for health. In addition, it can release healthy chemicals into the brain, which is beneficial for mood, energy, and well-being.

Answer:

Since the average American will spend 24 hours watching television per week, it is safe to say that they suffer from a lack of movement and exercise. This, in turn, will lead more Americans to be overweight and more likely to suffer from serious health problems! :)

Explanation:


c) 64 + {40 ÷ (4-7 + 8)} - 10
please solve this ​

Answers

Answer:

62

Explanation:

I am stuck on these 2 questions. Can someone help me please?

6) Write a Python code to save the following dictionary in a CSV file.
dict = {1: "Hello", 2: "Hi", 3:"bye"]

7) Write a Python code to read the CSV file generated in the previous step
(1) to a Python dictionary.​

Answers

Answer:

My answer could not be submitted because of some signs and symbols in my solution.

So, I've added the answer and a comprehensive explanation as an attachment.

Note that the question is answered using Python programming language.

Explanation:

Lines that start with # are used to explain the program

See attachment

Help me pls!!


Look at the following assignment statements:

food1 = "water"
food2 = "melon"

What is the correct way to concatenate the strings?

newFood = word1 == word2
newFood = word1 + word2
newFood = word1 * word2
newFood = word1 - word2

Answers

new food = word1 + word2 will connect both words together with no space in between. The value of newFood will now be "watermelon"

Answer:

new food = word1 + word2

Explanation:

what are some tips to stay focused in school, and to complete work faster? ​

Answers

Answer:

Sometimes listening to music or chewing gum.

Explanation:

When I need to focus, I like listening to music and sucking on a hard candy or chewing gum.

Pls give Brainliest!!

Answer:

What I do to focus in school is to try and ignore everything that is going on around you. ( what your classmates are doing ) Drown out the noise with music if your allowed to listen to music. Ask the teacher is you can go somewhere quieter

Explanation:

Hope this helps, Have a Wonderful Day!!

Challenge #3: Create a network that keeps everyone connected even if one of the lines is cut Insert as many lines as needed

Answers

Answer:

To create a redundant computer network, The star network topology is adopted.

Explanation:

Note that topology is not a type of network but a top view of how the network looks like or is connected.

To make a network redundant, interconnect every computer to one another in the network, so even when a line or an ethernet cable ( the connector) makes, there is no loss of connection.

This form of network is not recommended for large computer networks as it would result in confusion due to excess connection cables running in the network.

Which of the following is a good way to find a research topic

A. Personal Experience
B. Getting an idea from an advisor
C. Looking for the next step in the research process
D. All of the above

I need the answer quickly giving brainliest to the first person who answers

Answers

Answer:

Im bored wanna talk?

Explanation:

PLEASE HELP WITH THIS "PROJECT"
Your users are young children learning their arithmetic facts. The program will give them a choice of practicing adding or multiplying.

You will use two lists of numbers.

numA = [4, 1, 6, 10, 2, 3, 7, 9, 11, 12, 5, 8]

numB = [2, 12, 10, 11, 1, 3, 7, 9, 4, 8, 5, 6]

If the user chooses adding, you will ask them to add the first number from each list. Tell them if they are right or wrong. If they are wrong, tell them the correct answer.
Then ask them to add the second number in each list and so on.

If the user chooses multiplying, then do similar steps but with multiplying.

Whichever operation the user chooses, they will answer 12 questions.

Write your program and test it on a sibling, friend, or fellow student.

Errors : Think about the types of errors a user can make. Add at least one kind of error handling to your program.

Answers

numA = [4, 1, 6, 10, 2, 3, 7, 9, 11, 12, 5, 8]

numB = [2, 12, 10, 11, 1, 3, 7, 9, 4, 8, 5, 6]

operation = input("Are you adding or multiplying? (a/m)")

i = 0

if operation == "a":

   while i < len(numA):

       try:

           answer = int(input("{} + {} = ".format(numA[i], numB[i])))

           if answer == numA[i] + numB[i]:

               print("You're correct!")

           else:

               print("You're wrong! The correct answer is {}".format(numA[i] + numB[i]))

           i+=1

       except ValueError:

           print("Please enter a number!")

if operation == "m":

   while i < len(numB):

       try:

           answer = int(input("{} * {} = ".format(numA[i], numB[i])))

           if answer == numA[i]*numB[i]:

               print("You're correct!")

           else:

               print("You're wrong! The correct answer is {}".format(numA[i]*numB[i]))

           i+=1

       except ValueError:

           print("Please enter a number!")

The type of error handling we perform is ValueError handling. Instead of getting an exception when the user enters a letter when they try to answer a math problem, we tell the user to enter a number.

I hope this helps!

4.8 Code Practice: Question 1

Instructions
Write a for loop to print the numbers 5, 10, 15 … 75 on one line.

Expected Output
5 10 15 20 25 30 35 40 45 50 55 60 65 70 75

Answers

Answer:

c = 1 # global variable

    jhjl jh

def add(): c = 1 # global variable

def add():

   print(c)

add()

   c = c + 2 # increment c by 2

   print(c)

add()

Explanation:

Answer:

for x in range(1, 16):

   print(x * 5, end=" ")

Explanation:

Hope this helps!

What do the different top level domain names signify, including .com, .org, .edu, .gov, .mil, and .net?

Answers

Answer:

They signify different purposes for each website

Explanation:

.gov = A government owned website. Can include non-U.S. governmen websites, the White House, or other government owned websites.

.edu = A domain name for organizations with a focus on education (even for those that are non-U.S.). That means that you can find .edu domains on college websites, universities, and other educational institutions.

.mil = Mil is a shortening of military. It is for the U.S. Department of Defense and subsidiary or affiliated organizations.

.org = Org is a shortening of organization, meaning that this domain name is usually for non-profits and personal sites, but can also be used schools, open-source projects, and even some for-profit organizations.

.com = A website with the domain name .com signifies a commercial website (hence the 'com'). This can include business websites, websites that want to make money online, personal websites, blogs, portfolios, and more.

.net = Comes from the word network. Originally, it was supposed to be only for organizations involved in networking technologies, such as Internet service providers and other infrastructure companies, but restrictions were never enforced so .net was used as an general purpose name space. However, it's still popular with network operators and the advertising sector.

What are three print output options available in PowerPoint?
A. Handouts, Slides, Speaker Notes
B. Outline, Kiosk, Overheads
C. Overheads, Handouts, Slides
D. Kiosk, Handouts, Computer

Answers

Answer: .A

Explanation: i got it right

Answer:

'A' on edge 2020

Explanation:

Just took the test

Write a program that inputs a filename from the user and prints to the terminal a report of the wages paid to the employees for the given period. The report should be in tabular format with the appropriate header. Each line should contain an employee’s name, the hours worked, and the wages paid for that period.

Answers

Answer:

filename = input("Enter file name: ")

file = open("filename", "r")

while file:

   line = file.readline()

   print(line)

file.close()

   

Explanation:

The python source code prompts the user for a file name (file extension included), opens the file and reads the content of the file to the end, one line at a time, and prints it.

Note that the file is closed at the end of the program to avoid leakage.

The program illustrates the use of file manipulation.

File manipulations are used to read from a file, and also write into it.

The program in Python, where comments are used to explain each line is as follows:

#This gets the file name

fname = input('Enter input file name: ')

#This prints the output header

print('Name\t\tHours\t\tTotal Pay')

#This iterates through each line of the file

for line in open(fname):

   #This gets the text on the current line

   cline = line.strip()

   #If the text is not empty,

   if cline != '':

       #This gets the name, wage and time worked on that line

       (name, wage, time) = cline.split()

       #This converts the time to integer

       time = int(time)

       #This calculates the total pay

       totalpay = float(wage) * time

       #This prints the employee details

       print(name,'\t\t', time,'\t\t' totalpay))

Read more about file manipulations at:

https://brainly.in/question/10211834

The manipulation of data files on a computer using a file browser is
.

A
is a computer program that allows a user to manipulate files.

A
is anything that puts computer information at risk.

Errors, flaws, mistakes, failures, or problems in a software program are called
.

Software programs that can spread from one computer to another are called
.

Answers

Answer:

The answers are system management. Next, file manager. After, security threat. Second to last, bugs. Last, system management tools.

Explanation:

I did the edg 2020. mark me as brainiest please.

Answer:

1.) file management

2.) file manager

3.) security threat

4.) bugs

5.) viruses

Explanation:

did it in edge

Other Questions
I only need to worry about being influenced by media when I am watchingadvertisingTrue or false The author uses a word that means "causing impatience, annoyance, or displeasure." Click on theword in the text that best represents that idea.The kitchen? This is making even less sense now. My grandmother never allowsanyone but my mom into her kitchen! Why on earth is she insisting I come over here on aSaturday and head to the kitchen? When I turn to say goodbye to Mom, she gives me a winkand a hug and whispers into my ear, "Congratulations, Claudia. I'm so proud of the young ladyyou have become." I seriously have no idea what is going on here, and I must admit that thiswhole thing is becoming increasingly more aggravating,And then, as I walk in to Abuela's kitchen, it begins to make a lot more sense. Sitting onher kitchen table are an apron and The Book. I turn to Abuela, and she offers me a glowingsmile. "You have made it, Claudia," she whispers to me with a combination of nostalgia andpride. "Only the women in our family are given the privilege of knowing the secret recipesfound in The Book. My Abuela shared its contents with me when I turned thirteen, and now Ihave the honor of sharing it with you." What is an angle that is supplementary to 3? Based on what was shown, why does the Chinese government censor some Western-style TV shows? Check all that apply. to help uphold law and order in China to promote Chinese sports over American activities to support Chinese ideas related to morals and ethics to encourage Chinese citizens to reject Western beliefs to discourage Chinese youth from buying American products Please help with this Qu tipo de interpretacin denotativa o connotativa consideras que se debe dar a los tecnicismos y a los textos cientficos? Argumenta tu respuesta. what's (-9n^6) (8n) equal? A line passes through the points (8, 1) and (6, 7). What is the slope? A chef at a restaurant uses 17 pounds of butter each day. About how many grams does the chef use each day? Complete the sentence with the correct form of the verb in parenthesis. (tudier) Vous___________beaucoup. A sample of the mineral cinnabar has a mass of 251.1g and a volumeof 31.0 cm3. What is the density of cinnabar? Fugitive slave act of 17931. PART A: Which of the following best summarizes acentral idea of the text?A. Slavery has always been a controversial anddivided issue in the United States.B. Southern states, which were the majority slave-holding states, held great influence in Congressand their legislation.C. Runaway slaves were considered fugitives andcould then be hunted down, arrested, andretrieved.D. America allowed slaveholders to run wild all overthe country and the free states in search of theirmissing slaves. Michael fills 1/3 of one trash barrel with 1/9 of the leaves he has raked in his yard.How many trash barrels must he fill to pick up all of the leaves ? Help pleaseeeee ! for a friend W-4y+z=0 for z (please show work) what is the answer for -5x-8=3x+10 PLZZZ HELP questions are in the picture WILL GIVE BRAINLIEST hhhhhhhhhhhhhhhhhelp hhhhhhhhhhhhhhhhhelp hhhhhhhhhhhhhhhhhelp hhhhhhhhhhhhhhhhhelp hhhhhhhhhhhhhhhhhelp Two moles of acetyl chloride was mixed with two moles of dimethylamine. After the reaction is complete, what species can be found in the mixture Solve for h. -98 = -7h h =