Search Results
|
Post |
Author |
Forum |
Replies |
Views |
Posted
[asc]
|
|
|
Thread: Is this right/ what should i change?
Post: Index out of range
pour_list = [1,2,5,6,3,77,9,0,3,23,0.4,-12.4,-3.12]
for i in range(0, len(our_list), 2):
left = our_list[i]
right = our_list[i+1]
print("{0} - {1} = {2}".format(left, right, (left-right))... |
|
ralfi |
Homework |
6 |
4,325 |
Sep-22-2017, 08:11 PM |
|
|
Thread: While loops
Post: RE: While loops
List = ["1","2","3","5" ]
while True:
print("hello")
number = (int(input("give me a number? ")
if number % 2 == 0:
print(List)
File "<ipython-input-4-31e1ba2ca82e>", lin... |
|
ralfi |
General Coding Help |
4 |
3,560 |
Sep-21-2017, 03:15 AM |
|
|
Thread: While loops
Post: While loops
List = ["1","2","3","5" ]
while True:
print("hello")
number = (int(input("give me a number? ")
if i % 2 = 0:
print(L)
File "<ipython-input-3-4bed4d992b03>", line 5
i... |
|
ralfi |
General Coding Help |
4 |
3,560 |
Sep-21-2017, 02:11 AM |
|
|
Thread: Help
Post: Help
who can figure out this
Using a “while loop” ask the user for a number and add it to a list if number is even and to a different list if number is odd. Keep asking the user for a number until he says... |
|
ralfi |
General Coding Help |
1 |
2,454 |
Sep-20-2017, 07:20 PM |
|
|
Thread: Is this right/ what should i change?
Post: RE: Is this right/ what should i change?
output looks like this but I want it to subtract consecutive pairs of numbers:
our_list = [1,2,5,6,3,77,9,0,3,23,0.4,-12.4,-3.12]
for i in our_list:
print(i-1)Output:0
1
4
5
2
76
8
-1
2
22
-0.6
-... |
|
ralfi |
Homework |
6 |
4,325 |
Sep-20-2017, 07:18 PM |
|
|
Thread: Is this right/ what should i change?
Post: Is this right/ what should i change?
# 3. Using the following list and a “for” loop, display differences of all consecutive pairs of numbers in the list.
our_list = [1,2,5,6,3,77,9,0,3,23,0.4,-12.4,-3.12]
for i in our_list:
print(i-1) |
|
ralfi |
Homework |
6 |
4,325 |
Sep-20-2017, 06:12 PM |
|
|
Thread: I need to answer this: For the following list, print each element in the list an it’s
Post: I need to answer this: For the following list, pri...
Heres the code I put
List = ['a','b',1,2,[1,2,3,4],'hello',(4,5,6),7,True,"False",2.3]
for i in List:
print(i, type)Output:a <class 'type'>
b <class 'type'>
1 <class 'type'>
2 &l... |
|
ralfi |
General Coding Help |
1 |
2,376 |
Sep-20-2017, 05:23 PM |
|
|
Thread: Need help ASAP
Post: RE: Need help ASAP
can you fix it and post it again |
|
ralfi |
General Coding Help |
3 |
3,092 |
Sep-17-2017, 02:44 AM |
|
|
Thread: Need help ASAP
Post: Need help ASAP
Need help with this code, why does it have the error???????
gender =(input("What is your gender?"))
f= "female"
m="male"
Age = float(input("What is your age?"))
type= float
History =(input("Does your... |
|
ralfi |
General Coding Help |
3 |
3,092 |
Sep-17-2017, 02:28 AM |