Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
100% Quality Score
Upvotes Received
1
Posts with Upvotes
1
Upvoting Members
1
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
~11.9K People Reached
Favorite Forums
Favorite Tags
Member Avatar for vlady

Hello! I try to get py output to html table tag. I have a problem to create table in a table... Here is a pattern how it should look like (in yellow color) file name: format_DOC.doc here is the code I use to get a result. Pls can you help …

0
67
Member Avatar for vlady

Hello I try to get py output (s_subject) to a web bage table using html code. Thing is that result is in one line. I'd like to have it for each subject one line. Pls can you show me how to make it? Example: Predmet: maths fyzics history here is …

Member Avatar for woooee
0
189
Member Avatar for vlady

Hello, I need help to get all together. Pls see 2 different codes below . 1 code: Represents format for final result paper called "vysvedcenie" (evaluation) for a particular student. code: [CODE]def do_once(f): f() def do_twice(f): f() f() def do_four(f): do_twice(f) do_twice(f) def hlavicka(): print 'x',' '*40+'VYSVEDCENIE'+' '*46+'x' def vertikal(): …

0
58
Member Avatar for vlady

hi! I have another struggle. I'd like to have this kind of output: [COLOR="Green"]som object studenta: Janko Mrkvicka som object predmetu: fyzika, mam znamky: [4, 1] a priemer: 2,5[/COLOR] How can I make it? my output is a bit different (it is in last line): [COLOR="Red"]som object studenta: Janko Mrkvicka …

Member Avatar for Lucaci Andrew
0
131
Member Avatar for vlady

Hello! I don´t understand how to use a condition " if i == predmet: " i is an objet type of subject In my code I need to reach the condition: [ICODE]def add_mark(self,predmet,mark): for i in self.predmety: if i == predmet: print True[/ICODE] but I don´t know how to make …

Member Avatar for vlady
0
122
Member Avatar for vlady

Hello, pls can anybody show how works printing? here is the code: [CODE]class Student(object): def __init__(self, name): self.name = name self.report = dict() def add_subject(self, subject): self.report[subject] = list() def subjects(self): return self.report.keys() def s_subjects(self): lpre=[] for subject in self.subjects(): lpre.append(str(subject)) print lpre class Subject(object): def __init__(self, name, teacher = …

Member Avatar for Gribouillis
0
94
Member Avatar for vlady

Hello! Here is the code, pls have a look fist: [CODE]class Cstudent(): def __init__(self, name): self.name = name self.subjets = [] self.mark = [] def add_subject(self, subject): self.subjets.append(subject) def add_mark_student(self, subject, mark): subject.add_mark(mark) def __str__(self): return 'I am object of student: %s'% \ (self.name) def print_list_of_subjects(self): lst = [] for …

Member Avatar for vlady
0
115
Member Avatar for vlady

Hello, I am learning classes, and find it a bit difficult... :-( Mine intention is to add subject(predmet) and mark to the objet janko but if I search in self.predmety, I get False, means that it can't recognise predmet in self.predmety list State of self.predmety is as folloving: [<__main__.Cpredmet instance …

Member Avatar for vlady
0
86
Member Avatar for vlady

hello I have a problem concerning of changing mark. I don´t understand why it doesn´t work...thought the old_mark is type LIST. It works for one student and not for more (for loop) Pls can you help me? Thanks Vlady [CODE]def change_mark(changed_mark): for student in changed_mark: old_mark=changed_mark[student] position=old_mark.index[old_mark] old_mark[position] = raw_input('new_mark') …

Member Avatar for valorien
0
170
Member Avatar for vlady

Hello Guys! Can anybody help me with this code? So what I need? here is it: I want to fill out global variable "student_marks" with a grade for each student and keep it once is loaded. So it means without calling the function "def add_mark()" I will be able to …

Member Avatar for vlady
0
124
Member Avatar for vlady

helo, I learn Classes and methods according to a manual "Think Python: How to Think Like a Computer Scientist" I am stuck on "Polymorphism" There is a part using built-in function sum. I don't know what to do... It should be connected to __add__ function, but still the code must …

Member Avatar for vlady
0
121
Member Avatar for vlady

Hello, I am learning classes and object and I have a problem with this code. Simply does not work. Can you tell me the reason please? Error message tells me that Distance is not defined...(I don´t understand this message) Thank you for help! Vlady [CODE]class Distance(object): 'return distance between 2 …

Member Avatar for vlady
0
122
Member Avatar for vlady

Hello, I do the following exercise: [COLOR="Green"]Write a function called most_frequent that takes a string and prints the letters in decreasing order of frequency. Find text samples from several different languages and see how letter frequency varies between languages. Compare your results with the tables at wikipedia.org/wiki/Letter_frequencies.[/COLOR] I try my …

Member Avatar for vlady
0
987
Member Avatar for vlady

Hello, pls can anybody help me to break following string? example: output is 000 (type str) an I need to get [0,0,0] here is a script: [CODE]def test(n_input): bin_n=2 r=bin_n**n_input ## print r for x in range(r): ## print bin(x) f=str(bin(x))[2:].zfill(n_input) # x is type int, f is type str …

Member Avatar for TrustyTony
0
96
Member Avatar for vlady

Hello, I try to generate output (all posibilities) for logical AND. Nb inputs is 10 and that means there are 1024 combination. example: n i1 i2 i3 i4 i5 i6 i7 i8 i9 i10 output 1 0 0 0 0 0 0 0 0 0 0 0 2 0 0 …

Member Avatar for TrustyTony
0
169
Member Avatar for vlady

Hello, I make an exercise from a book : Think Python: How to Think Like a Computer Scientist by Allen B. Downey, Version 1.1.22, random words exercise 7. I made a script like this (see below) but how can I make list (named book) just once and since then after …

Member Avatar for TrustyTony
0
155
Member Avatar for vlady

I study manual "Think Python: How to Think Like a Computer Scientist by Allen B. Downey, Version 1.1.22, chapter 13, 13.6 Dictionary subtraction. There is an exercise 6. I did it by not using set types. The result will be the same? Pls can you show me how to use …

Member Avatar for vlady
0
76
Member Avatar for vlady

Hello, pls can somebody have a look at my script and tell me why I can't get a value from d1? (print d1). Thank you for help. here is a script: [CODE]def subtract(): d1=file1(filename) dd2=file2(filename) res = dict() print d1 ## for key in d1: ## if key not in …

Member Avatar for woooee
0
1K
Member Avatar for vlady

Hello, pls.can anybody help me? I try to solve a exercise where I need to involve random module. Here is a text: Exercise 2 In this example, ties are broken by comparing words, so words with the same length appear in alphabetical order. For other applications you might want to …

Member Avatar for vlady
0
137
Member Avatar for vlady

Hello, I learn tuples and I came acros the folloving explanation which I don't understand practicly because the scipt is not complet..., I think tha they want to show the direction but for me would be better complet example... so it's from document: Think Python (version 1.1.19) and text is …

Member Avatar for vlady
0
140
Member Avatar for vlady

Hello, Pls can somebody help me with time comparison between 2 scripts. I have already looked the documentation but I haven't found anything. I deal with following exercise: "Run this version of fibonacci and the original with a range of parameters and compare their run times." I intend to measure …

Member Avatar for vlady
0
139
Member Avatar for vlady

Hello, I am learning dictionaries and I need help. Here is a script and the task is to modify print_hist to print the keys and their values in alphabetical order. I imagine that the result should be like this: d 2 o 1 r 1 v 1 thing is I …

Member Avatar for woooee
0
136
Member Avatar for vlady

hello, pls, can anybody help? I try to print words which contains forbidden letters but counting without them and excluding the words which has the smallest number of letters. example: words = 'hello this is my test' forbidden = 'h, t, e' 1. hello this test -> these word contains …

Member Avatar for sneekula
0
121
Member Avatar for vlady

hello, Pls can anybody help me with a folloving exercise? (I must say that I am really beginer in this field, learning by myself and with daniweb (if sb gives me help)) Pompt the user to enter a string of forbidden letters and also to enter a words. Make a …

Member Avatar for vlady
0
121
Member Avatar for vlady

Hi everybody, Again, I try to deal with exercise from a book Think Python version 1.1.19., exercise 9.2. (case study: world play) My contents of the words.txt is: "Ahoj, Toto je moj prvy pokus otvorit a citat subor. Vela stastia " Thing is, if you have a look at a …

Member Avatar for vlady
1
248
Member Avatar for vlady

Hi everybody, Pls give me sb. a hint. I do this following exercise but I struggle with reading another lines of txt. Here is the text: Exercise 9.1 Write a program that reads words.txt and prints only the words with more than 20 characters (not counting whitespace). here is my …

Member Avatar for vlady
0
4K
Member Avatar for vlady

hello, pls can somebody show me a way how to solve the following exercise: A number, a, is a power of b if it is divisible by b and a/b is a power of b. Write a function called is_power that takes parameters a and b and returns True if …

Member Avatar for vlady
0
3K