Question

jupyter fibo.pyv a few seconds ago File Edit View Language 1 def add(n): 2 return n+2In [546]: import fibo as fib k = fib.add(2) AttributeError Traceback (most recent call last) <ipython-input-546-5d91eeb591d2>

PYTHON, what am i doing wrong here

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

Try this one , i hope this will be helpful.

fibo.py

def add(n):
   return n+2

test.py

from fibo import *

k=add(2)

print(k)

Output:

> Windows Power PS C:\Users\user\Desktop> py test.py 4 PS C:\Users\user\Desktop> fibo - Notepad File Edit Format View Help de

Add a comment
Know the answer?
Add Answer to:
PYTHON, what am i doing wrong here jupyter fibo.pyv a few seconds ago File Edit View...
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
  • Don't understand why code isn't running properly Scottir.UnitB.py D/Python/Scottir UnitB.py (670 File Edit Format Run Options...

    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 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...

  • Need some explanation on what im doing wrong.? solved it, forgot to add strings # Get...

    Need some explanation on what im doing wrong.? solved it, forgot to add strings # Get N from the command line import sys N = int(sys.argv[1]) # Your code goes here if N == 100: print (Hit) else: print(Miss) use Conditions explained 2.5. Challenge == We will provide you with a number, N. . If N is equal to 100, output 'Hit' • otherwise, output 'Miss Remember that strings are case-sensitive! Check it! LAST RUN on 5/8/2020, 10:44:31 PM Program...

  • hello good night, could you help me to see what is wrong with my code, two...

    hello good night, could you help me to see what is wrong with my code, two errors appear at the bottom in red: In [47]: file_contents-open("color-blanco.png") def calculate_frequencies (file_contents): # Here is a list of punctuations and uninteresting words you can use to process your text punctuations = ""!()-[]{};:"",-./?@#$%^&*_~ uninteresting_words = ["the","in" ,"a", "to", "if", "is", "it", "of", "and", "or", "an", "as", "i", "me", "my", "we", "o # LEARNER CODE START HERE result={} a-file_contents.split() for word in a: if word...

  • What is wrong with my python code. I am receiving this error: Traceback (most recent call...

    What is wrong with my python code. I am receiving this error: Traceback (most recent call last): File "C:/Users/owner/Documents/numberfive.py", line 7, in if age > 18: TypeError: unorderable types: str() > int() My code is age= input("Enter your age:") if age > 18: print("You can vote.") else: print("You can't vote.") if age > 64: print ("You're a Senior Citizen...you deserve two votes") endofprogram = input("Please hit enter to exit from this program:")

  • CAN SOMEONE PLEASE EXPLAN FO ME WHATS WRONG WITH MY CODE WHEN EVEN I RUN IT...

    CAN SOMEONE PLEASE EXPLAN FO ME WHATS WRONG WITH MY CODE WHEN EVEN I RUN IT IT GIVE ME THIS MASSAGE IM USING python BTW Traceback (most recent call last):                                                                                                                                                 File "../resource/asnlib/public/RUN.py", line 20, in <module>                                                                                                                      exec(source_code, dict())                                                                                                                                                      File "<string>", line 60, in <module>                                                                                                                                          NameError: name 'total_rough_sod' is not defined ) from math import pi length = float(input('Enter Course Length:')) width = float(input('Enter Course Width:')) def calculate_smooth_sod(width): grean_area_raduis= (width/2)/2 total_smooth_sod=2*pi*(grean_area_raduis**2) return total_smooth_sod def calculate_sand_trap_area(width): sand_trap_radius=(width/3)/2 sand_trap_area=pi*(sand_trap_radius**2) return sand_trap_area def calculate_rough_sod(length,...

  • Starting out with Python 4th edition I need help I followed a tutorial and have messed...

    Starting out with Python 4th edition I need help I followed a tutorial and have messed up also how does one include IOError and IndexError exception handling? I'm getting errors: Traceback (most recent call last): File, line 42, in <module> main() File , line 37, in main winning_times = years_won(user_winning_team_name, winning_teams_list) File , line 17, in years_won for winning_team_Index in range(len(list_of_teams)): TypeError: object of type '_io.TextIOWrapper' has no len() Write program champions.py to solve problem 7.10. Include IOError and IndexError...

  • I am having trouble with my Python code in this dictionary and pickle program. Here is...

    I am having trouble with my Python code in this dictionary and pickle program. Here is my code but it is not running as i am receiving synthax error on the second line. class Student: def__init__(self,id,name,midterm,final): self.id=id self.name=name self.midterm=midterm self.final=final def calculate_grade(self): self.avg=(self.midterm+self.final)/2 if self.avg>=60 and self.avg<=80: self.g='A' elif self.avg>80 and self.avg<=100: self.g='A+' elif self.avg<60 and self.avg>=40: self.g='B' else: self.g='C' def getdata(self): return self.id,self.name.self.midterm,self.final,self.g CIT101 = {} CIT101["123"] = Student("123", "smith, john", 78, 86) CIT101["124"] = Student("124", "tom, alter", 50,...

  • Use the link in the Jupyter Notebook activity to access your Python script. Once you have...

    Use the link in the Jupyter Notebook activity to access your Python script. Once you have made your calculations, complete this discussion. The script will output answers to the questions given below. You must attach your Python script output as an HTML file and respond to the questions below. In this discussion, you will apply the statistical concepts and techniques covered in this week's reading about hypothesis testing for the difference between two population proportions. In the previous week’s discussion,...

  • Attention!!!!!!! I need python method!!!!!!!!! the part which need to edit is below: i nee...

    attention!!!!!!! I need python method!!!!!!!!! the part which need to edit is below: i need python one!!!!!!!!! the part below is interface for the range search tree which don’t need to modify it. Week 3: Working with a BST TODO: Implement a Binary Search Tree (Class Name: RangesizeTree) Choose one language fromJava or Python. Iin both languages,there is an empty main function in the Range Size Tree file. The main function is not tested, however, it is provided for you...

  • For my computer class I have to create a program that deals with making and searching...

    For my computer class I have to create a program that deals with making and searching tweets. I am done with the program but keep getting the error below when I try the first option in the shell. Can someone please explain this error and show me how to fix it in my code below? Thanks! twitter.py - C:/Users/Owner/AppData/Local/Programs/Python/Python38/twitter.py (3.8.3) File Edit Format Run Options Window Help import pickle as pk from Tweet import Tweet import os def show menu():...

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