Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Don't understand why code isn't running properly Scottir.UnitB.py D/Python/Scottir UnitB.py (670 File Edit Format Run Options Window Help #Declare a variab i e and initialize

Don't understand why code isn't running properly

image text in transcribed

image text in transcribed

Scottir.UnitB.py D/Python/Scottir UnitB.py (670 File Edit Format Run Options Window Help #Declare a variab i e and initialize it def displayInstructions (1angCode): 3tr . ENGLISHPROMPT = "Please enter your weight in pound >> " str.SPANISH PROMPT Por favor entre en su peso en libras > if langCode1: - print ("ENGLISH prompt) print ("SPANISH prompt") print ("Stop") elif langCode2 else: code input ( Enter code for instructions") num code weight = input ("Enter weight for moon") num-weight numMoON FACTOR 0.166 moonWeight (floet (weight) MOON FACTOR) nummoonWeight print (" HEnglish 2Espanol >) displayInstructions (code) code1: weight the: moon would be,moonWeight) on print ("Your +1it code2 eise: Iprine("Sos print ("Su stso enila una aeria", moonWeight Python 3.7.0 Shell File Edit Shell Debug Options Window Help Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:06:47) [MSC v. 1914 32 1)1 on win32 Type "copyright", "credits" or "license 0" for more intormation. RESTART: D:/Python/Scottur.UnitB.py Enter code for instructions food Enter weight for moon 25 1English or 2Espanol >> Traceback (most recent call last): File "D:/Python/ScottJr.UnitB.py", line 19, in displayInstructions (code) File "D: / python/Scot t Jr . UnitB.", line 3, display!nstructions in Str.ENGLISH PROMPT Please enter your weight in pounds TypeError: can't set attributes of built-in/extension type 'str RESTART: D: /Python/Scot tJr . Units.py --=-=-sa-- Enter code for instructions 23 Enter weight for moon 25 1English or 2Espanol Traceback (most recent call last): F1le "D:/Python/ScottJz UnitB.py, line 19, an diaplayInstructions ucods) File "D:/Python/ScottJr.th..", line 3 An displayInstructions str.ENGLISHPROMPT -.Pleaselenter your neight Ani poanda >> - TypeErzor: canset attributes fbuilt in/'extension Type here to search

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

Database In Depth Relational Theory For Practitioners

Authors: C.J. Date

1st Edition

0596100124, 978-0596100124

More Books

Students also viewed these Databases questions

Question

Differentiate among family types and their strengths and weaknesses

Answered: 1 week ago