Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Function to convert
Post: RE: Function to convert

def numberToText(x): if x==1: return "one" elif x==2: return "two" elif x==3: return "three" def count(numOne,numTwo): numberToText() for i in range (numOne,numTwo): print i print count(1,3)
slehee Homework 7 3,940 Oct-22-2017, 08:57 PM
    Thread: Function to convert
Post: RE: Function to convert

Yes, I did mistype the semicolon, The instruction is to write a function which asks for a single parameter, in my case a number and it will return a string( for number 1="one") it should handle number...
slehee Homework 7 3,940 Oct-22-2017, 08:44 PM
    Thread: Function to convert
Post: RE: Function to convert

The task is to write a function which will associate the number with a text, so have to make one.
slehee Homework 7 3,940 Oct-22-2017, 08:20 PM
    Thread: Function to convert
Post: Function to convert

How to write a function that takes a single parameter ( for example numbers from 1-10) then returns a string like "one" to number 1 and "two" to number 2. def numberconvert(x):     if x== 1;     retu...
slehee Homework 7 3,940 Oct-22-2017, 07:59 PM
    Thread: Functions with parameters
Post: RE: Functions with parameters

def count(numOne, numTwo): for i in range (numOne,numTwo): print i print count(5,16) this would print out what I need (numbers between 5-15) but I'm ...
slehee Homework 2 3,189 Oct-20-2017, 07:47 PM
    Thread: Functions with parameters
Post: Functions with parameters

Hi, How would you write a function which takes two parameters and then counts from the first parameter to the second one? def count(numOne, numTwo): for i in ...
slehee Homework 2 3,189 Oct-20-2017, 07:00 PM

User Panel Messages

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