Python Forum
How to stop inputs on the presence of CR
Thread Rating:
  • 1 Vote(s) - 2 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to stop inputs on the presence of CR
#3
This program works very well with C++. I think it should be the same with python3. I modified a little my code Here thenew
# file4.py
import sys
def getvalue(value, sum):
    value=input("enter the value ")
    print("value entered : ", value)
    #if input=CR then return
    sum += value#put value into sum, (apparently correct for only integers)
    print("sum", sum)
    return ;#value;



size=40
print("here is the addition of many numers (even with a .) Maximum of numbers=",size)
print("once you have finished your list of numbers, just press ENTER to indicate the end\n")
sum=0.0
value=0.0
count=1
while (count != 0):
        getvalue(0,0)
        count=count +1
        
Reply


Messages In This Thread
How to stop inputs on the presence of CR - by sylas - Apr-15-2017, 01:50 PM
RE: How to stop inputs on the presence of CR - by sylas - Apr-16-2017, 06:17 AM
stop input on a CR - by sylas - Apr-20-2017, 06:19 AM
RE: stop input on a CR - by volcano63 - Apr-20-2017, 08:54 AM
RE: stop input on a CR - by sylas - Apr-20-2017, 09:20 AM
RE: stop input on a CR - by volcano63 - Apr-20-2017, 09:25 AM
RE: stop input on a CR - by metulburr - Apr-20-2017, 11:35 AM
RE: stop input on a CR - by Kebap - Apr-20-2017, 04:56 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Checking the presence of label using pywinauto module Malt 0 1,976 Jul-26-2019, 09:06 AM
Last Post: Malt
  [split] Check presence of a file pascale 25 11,315 Jul-08-2018, 12:23 PM
Last Post: pascale
  Check presence of a file Steffenwolt 8 5,870 May-25-2018, 07:04 AM
Last Post: Steffenwolt

Forum Jump:

User Panel Messages

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