Python Forum
Called Functions Not Working
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Called Functions Not Working
#1
So I am trying to do Five Nights at Freddy's in real life and I need a calculator to see how much power we have left. But I keep running into a problem. I defined a few functions (Using the lights, closing the doors), and called them, but for some reason when I run the script and try to use them it does not work. It's not an error. I will type the function 'l' when running the code and it gives me: <function l at *Random numbers, letters, and symbols*

import time
power = 100 

power_calc = input("l is left door, r is right door, and f is flashlight. Awaiting Input:")
if len(power_calc) < 0:
        print("empty")

#this is for l
def l():
        if power_calc is 1:
                time_1 = time
def ll():
        if power_calc is ll:
            time_2 = time
            time_total_1 = int(time_1) - int(time_2)
            power - time_total_1  

#this is for r
def r():
        if power_calc is r:
                time_3 = time

def rr():
        if power_calc is rr:
            time_4 = time
            time_total_2 = int(time_3) - int(time_4)
            power - time_total_2

#this is for f
def f():
        power - 2

l()
ll()
r()
rr()
f()

if power == 0:
        print("Game Over")
And this is what it will give me when I run it:

Output:
Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:06:47) [MSC v.1914 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more information. >>> RESTART: C:\Users\Steven & Alisha\AppData\Local\Programs\Python\Python37-32\FNaF power calculator.py l is left door, r is right door, and f is flashlight. Awaiting Input: >>> l <function l at 0x033A3C90> >>>
Reply


Messages In This Thread
Called Functions Not Working - by WhatAmIDoing09 - Jul-12-2019, 12:51 AM
RE: Called Functions Not Working - by SheeppOSU - Jul-12-2019, 01:40 AM
RE: Called Functions Not Working - by woooee - Jul-12-2019, 06:51 PM
RE: Called Functions Not Working - by ichabod801 - Jul-12-2019, 07:02 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  two functions working in a strange way zapad 2 326 May-02-2024, 01:35 PM
Last Post: zapad
  Multiple variable inputs when only one is called for ChrisDall 2 539 Oct-20-2023, 07:43 PM
Last Post: deanhystad
  Couldn't install a go-game called dlgo Nomamesse 14 3,294 Jan-05-2023, 06:38 PM
Last Post: Nomamesse
  how can a function find the name by which it is called? Skaperen 18 3,609 Aug-24-2022, 04:52 PM
Last Post: Skaperen
  function with 'self' input parameter errors out with and without 'self' called dford 12 3,282 Jan-15-2022, 06:07 PM
Last Post: deanhystad
  What is this formatting called? Mark17 2 1,825 Dec-14-2020, 08:42 PM
Last Post: snippsat
  Does anyone have unicurses panel functions working on a Windows 10 platform? pjfarley3 0 1,506 Oct-11-2020, 04:41 AM
Last Post: pjfarley3
  Class Instances called in the wrong order IanIous 4 2,928 Mar-06-2020, 02:16 PM
Last Post: IanIous
  How do you add the results together each time a function is called? Exsul 10 5,291 Aug-09-2019, 09:18 PM
Last Post: ichabod801
  Getting error when called through instance method aankrose 2 2,643 Mar-02-2019, 07:19 PM
Last Post: aankrose

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020