Search Results
|
Post |
Author |
Forum |
Replies |
Views |
Posted
[asc]
|
|
|
Thread: function help (totaly beginner)
Post: RE: function help (totaly beginner)
(Dec-12-2017, 08:48 PM)wavic Wrote: So you take a letter of the word and you get the index of that letter in the list and move it to the right - add 1 to the index. Check if the letter is the last o... |
|
thanikos |
Homework |
16 |
7,262 |
Dec-13-2017, 08:32 PM |
|
|
Thread: function help (totaly beginner)
Post: RE: function help (totaly beginner)
(Dec-11-2017, 09:54 PM)wavic Wrote: (Dec-07-2017, 01:10 PM)wavic Wrote: create a variable which will contain the final result and put a '*' in it during the initialization. On each iteration add a... |
|
thanikos |
Homework |
16 |
7,262 |
Dec-12-2017, 07:12 PM |
|
|
Thread: function help (totaly beginner)
Post: RE: function help (totaly beginner)
(Dec-11-2017, 02:02 AM)wavic Wrote: **shy** I told you how. Just fallow the steps.
I still can't fix it, i'm a total beginner,but Thank you anyway for trying to help. |
|
thanikos |
Homework |
16 |
7,262 |
Dec-11-2017, 08:55 AM |
|
|
Thread: function help (totaly beginner)
Post: RE: function help (totaly beginner)
(Dec-07-2017, 03:07 PM)gruntfutuk Wrote: At least you've made a start and put some structure in place.
def stars(s):
letters = len(s)
n = letters-1
for i in range(letters):You don't nee... |
|
thanikos |
Homework |
16 |
7,262 |
Dec-10-2017, 11:25 PM |
|
|
Thread: function help (totaly beginner)
Post: RE: function help (totaly beginner)
We haven't learn the join method yet, I think it is only to iterate over the word and construct the final result manually. format method is propably ok too |
|
thanikos |
Homework |
16 |
7,262 |
Dec-07-2017, 12:56 PM |
|
|
Thread: function help (totaly beginner)
Post: RE: function help (totaly beginner)
The program asks the user to input any word, and the program will print the same word but with stars * between all the letters of the word. example if user inputs a word like "computer" the program wi... |
|
thanikos |
Homework |
16 |
7,262 |
Dec-07-2017, 12:44 PM |
|
|
Thread: function help (totaly beginner)
Post: function help (totaly beginner)
Hello i have this assignment and i don't know how to continue.
User will write a word , example, table, and the program will print *t*a*b*l*e*
I appreciate your help
Here is where i am with my code:... |
|
thanikos |
Homework |
16 |
7,262 |
Dec-07-2017, 12:32 PM |
|
|
Thread: Help with array smallest biggest number
Post: RE: Help with array smallest biggest number
(Nov-30-2017, 10:43 AM)Larz60+ Wrote: >>> zz = [5, 78, 4, -1, 974, 22, 1053]
>>> min(zz)
-1
>>> max(zz)
1053
>>> sum(zz)/len(zz)
305.0
>>>
Thank you so m... |
|
thanikos |
Homework |
4 |
3,250 |
Nov-30-2017, 01:06 PM |
|
|
Thread: Help with array smallest biggest number
Post: RE: Help with array smallest biggest number
(Nov-30-2017, 02:11 AM)Prrz Wrote: (Nov-30-2017, 12:44 AM)thanikos Wrote: Hello
I need some help to: User inserts 10 numbers that goes to an array, and then the program prints the smallest number... |
|
thanikos |
Homework |
4 |
3,250 |
Nov-30-2017, 10:24 AM |
|
|
Thread: Help with array smallest biggest number
Post: Help with array smallest biggest number
Hello
I need some help to: User inserts 10 numbers that goes to an array, and then the program prints the smallest number, the biggest number and the average of all 10 numbers.
This is an exercise th... |
|
thanikos |
Homework |
4 |
3,250 |
Nov-30-2017, 12:44 AM |
|
|
Thread: Help with loop
Post: RE: Help with loop
(Nov-26-2017, 09:30 PM)buran Wrote: you should use string formatting
for nr in range(0, 100):
print('{: >2}'.format(nr), end=" ")
if nr % 10 == 9:
print()
Thank you buran ! |
|
thanikos |
Homework |
13 |
6,191 |
Nov-27-2017, 09:56 AM |
|
|
Thread: Help with loop
Post: RE: Help with loop
(Nov-26-2017, 08:49 PM)striver Wrote: Like that
for nr in range(0, 100):
if nr < 10:\
print(" ", end="")
print(nr, end=" ")
if nr % 10 == 9:
print()Thank you striver! ... |
|
thanikos |
Homework |
13 |
6,191 |
Nov-26-2017, 09:01 PM |
|
|
Thread: Help with loop
Post: RE: Help with loop
(Nov-26-2017, 07:18 PM)striver Wrote: Try that
for nr in range(1, 100):
print(nr, end=" ")
if nr % 10 == 9:
print()1 2 3 4 5 6 7 8 9
10 11 12 13 14 15 16 17 18 19
20 21 22 23 24 2... |
|
thanikos |
Homework |
13 |
6,191 |
Nov-26-2017, 08:06 PM |
|
|
Thread: Help with loop
Post: Please help with loop
Hello again
i have this code:
for nr in range(1,100,1):
print(nr, end=" ")
if nr == 9:
print(nr)
elif nr == 19:
print(nr)
elif nr == 29:
print(nr)
elif nr ... |
|
thanikos |
Homework |
13 |
6,191 |
Nov-26-2017, 06:59 PM |
|
|
Thread: Help with loop
Post: RE: Help with loop
(Nov-26-2017, 05:36 PM)heiner55 Wrote: for ...
print(nr, end="")
if nr == 9:
print()
...
Getting somewhere but i gett two 9, two 19, two 29..... at the end of each row...
for nr ... |
|
thanikos |
Homework |
13 |
6,191 |
Nov-26-2017, 05:47 PM |
|
|
Thread: Help with loop
Post: RE: Help with loop
(Nov-26-2017, 05:20 PM)heiner55 Wrote: Could you indent your code ?
There is a modulo-operator.
Hi again,
No i'm not sure what to do, any tips? |
|
thanikos |
Homework |
13 |
6,191 |
Nov-26-2017, 05:25 PM |
|
|
Thread: Help with loop
Post: Help with loop
Hello
Any ideas how to do this:
0 1 2 3 4 5 6 7 8 9
10 11 12 13 14 15 16 17 18 19
20 21 22 23 24 25 26 27 28 29
30 31 32 33 34 35 36 37 38 39
40 41 42 43 44 45 46 47 48 49
50 51 52 53 54... |
|
thanikos |
Homework |
13 |
6,191 |
Nov-26-2017, 05:16 PM |
|
|
Thread: If else help
Post: RE: If else help
(Nov-25-2017, 03:37 PM)heiner55 Wrote: Good work.
**dance** **smile** |
|
thanikos |
Homework |
10 |
5,496 |
Nov-25-2017, 03:40 PM |
|
|
Thread: If else help
Post: RE: If else help
(Nov-25-2017, 03:24 PM)heiner55 Wrote: Have you tested your code ?
(fotbolls: 2018 2020 2022)
Yes, it works
2018 is footbol
2020 is olympic
2022 is footbol |
|
thanikos |
Homework |
10 |
5,496 |
Nov-25-2017, 03:34 PM |
|
|
Thread: If else help
Post: RE: If else help
(Nov-25-2017, 03:01 PM)heiner55 Wrote: Then show us your code.
Here it is, the comments are in swedish....
year = int(input("Ange ett år mellan 1950-2050: "))
if year<1950 or year>2050:
p... |
|
thanikos |
Homework |
10 |
5,496 |
Nov-25-2017, 03:23 PM |