Search Results
|
Post |
Author |
Forum |
Replies |
Views |
Posted
[asc]
|
|
|
Thread: calculation with list in list
Post: RE: calculation with list in list
(Aug-09-2019, 06:39 AM)gianniskampanakis Wrote: Σε ευχαριστώ το type(i) εκτός από int τι τιμες μπορεί να πάρει στην περίπτωση μας ;you are welcome, can take str list dict etc.. below an example with... |
|
cvsae |
General Coding Help |
13 |
4,553 |
Aug-09-2019, 09:55 AM |
|
|
Thread: calculation with list in list
Post: RE: calculation with list in list
Γεια σου γιαννη
l = [1,2,3,[1,2]]
def suml(l, s=0):
for i in l:
if type(i) == int:
s +=i
else:
return suml(i, s)
return sl = [1,2,3,[1,2]]
def ... |
|
cvsae |
General Coding Help |
13 |
4,553 |
Aug-08-2019, 11:19 PM |
|
|
Thread: Can't find a proble here
Post: RE: Can't find a proble here
(Aug-04-2019, 08:23 PM)ofir_l Wrote: def ex10():
mark1 = int(input("Insert math score"))
mark2 = int(input("Insert Computer Science score"))
mark3 = int(input("Insert physics sc... |
|
cvsae |
General Coding Help |
2 |
1,900 |
Aug-04-2019, 09:39 PM |
|
|
Thread: Coding issue
Post: RE: Coding issue
You can use dict to store usernames and passwords instead of list, and save dict to a file and load it each time when you run the *program check my example bellow
import json
import os
auth_file =... |
|
cvsae |
General Coding Help |
2 |
31,271 |
Aug-02-2019, 08:54 PM |
|
|
Thread: Group files according to first few characters in filename
Post: RE: Group files according to first few characters ...
(Aug-02-2019, 05:56 AM)perfringo Wrote: Observation: I would avoid misleading names. Not good to have name file_list for dictionary.
You are right |
|
cvsae |
General Coding Help |
7 |
4,728 |
Aug-02-2019, 06:34 AM |
|
|
Thread: Count elements in a list only if they are following each other and are similar
Post: RE: Count elements in a list only if they are foll...
(Aug-01-2019, 10:24 PM)law Wrote: Thanks, let me try thiscan you give me an example want do you want as result ?? |
|
cvsae |
General Coding Help |
10 |
4,638 |
Aug-01-2019, 10:30 PM |
|
|
Thread: Count elements in a list only if they are following each other and are similar
Post: RE: Count elements in a list only if they are foll...
try this
fruits=['mango','orange','apple','lemon','apple','apple','apple','banana','avocado','apple','mango','pineapple','orange','apple']
def countFruit(fruit):
for x in range(0, len(fruits) -... |
|
cvsae |
General Coding Help |
10 |
4,638 |
Aug-01-2019, 10:23 PM |
|
|
Thread: Group files according to first few characters in filename
Post: RE: Group files according to first few characters ...
(Aug-01-2019, 06:39 PM)python_newbie09 Wrote: (Aug-01-2019, 11:32 AM)Friend Wrote: i don't know why this shouldn't work, what exactly didn't work by using 'startswith':
if filename.startswith('..... |
|
cvsae |
General Coding Help |
7 |
4,728 |
Aug-01-2019, 08:23 PM |
|
|
Thread: Group files according to first few characters in filename
Post: RE: Group files according to first few characters ...
(Aug-01-2019, 10:36 AM)python_newbie09 Wrote: I used the script below that worked for one set of files that had the same name in different folders but for this second set of files, it only shares th... |
|
cvsae |
General Coding Help |
7 |
4,728 |
Aug-01-2019, 11:24 AM |
|
|
Thread: AttributeError: 'area' object has no attribute 'areaofcircle'
Post: RE: AttributeError: 'area' object has no attribute...
(Aug-01-2019, 10:31 AM)shane1236 Wrote: what do you mean? where should I declare radius? and is it only problem for radius or other parameters like length and etc..
does the code wich you use are th... |
|
cvsae |
General Coding Help |
5 |
4,175 |
Aug-01-2019, 10:47 AM |
|
|
Thread: AttributeError: 'area' object has no attribute 'areaofcircle'
Post: RE: AttributeError: 'area' object has no attribute...
(Aug-01-2019, 09:56 AM)shane1236 Wrote: Hello everyone,
I'm facing trouble in the following code, can somebody help me.I am new here even I don't know how to post my code sorry about that. One more... |
|
cvsae |
General Coding Help |
5 |
4,175 |
Aug-01-2019, 10:23 AM |
|
|
Thread: want better option name for a conversion function
Post: RE: want better option name for a conversion funct...
Hello Skaperen, variable names can be any combination of characters, it is good practice to use names that imply their content, making the program easier to read and understand. digitsis preferable to... |
|
cvsae |
News and Discussions |
2 |
1,968 |
Jul-31-2019, 11:26 PM |
|
|
Thread: New Users Introduce Yourself
Post: RE: New Users Introduce Yourself
Im cvsae, fan of Cryptography, Steganography, and Privacy!! ..... I am glad to have joined on python-forum.io.. |
|
cvsae |
Bar |
431 |
230,042 |
Jul-31-2019, 09:10 PM |
|
|
Thread: [split] max and min
Post: RE: [split] max and min
(Jul-30-2019, 05:02 PM)Tbakks Wrote: largest = None
smallest = None
while True:
nums = input("Enter a number: ")
if nums == "done":
break
try:
num = ... |
|
cvsae |
Homework |
2 |
2,909 |
Jul-30-2019, 10:29 PM |
|
|
Thread: Parsing json - dictionary with in dictionary
Post: RE: Parsing json - dictionary with in dictionary
(Jul-30-2019, 09:26 PM)krish216 Wrote: Thanks @cvsae for the quick help.you're welcome |
|
cvsae |
General Coding Help |
6 |
3,655 |
Jul-30-2019, 10:01 PM |
|
|
Thread: Formatting Output after Web Scrape
Post: RE: Formatting Output after Web Scrape
Hello can you post the code wiuch you use for scraped ? |
|
cvsae |
Web Scraping & Web Development |
2 |
2,485 |
Jul-30-2019, 08:34 PM |
|
|
Thread: '<' not supported in web Element and webElement
Post: RE: '<' not supported in web Element and webElemen...
(Jul-30-2019, 01:46 PM)law Wrote: Hello Friends,
I'm scrapping data(numbers) from an online site, saving it in variable A&B and using comparison operator < to
check if A<B but am receiving... |
|
cvsae |
General Coding Help |
2 |
2,870 |
Jul-30-2019, 01:54 PM |
|
|
Thread: If Statement Help
Post: RE: If Statement Help
(Jul-30-2019, 01:12 PM)VictorVictus Wrote: (Jul-30-2019, 01:03 PM)cvsae Wrote: i dont know if understand correcly but i wil try to help cann you provided the expected results ??
try this
is_... |
|
cvsae |
General Coding Help |
6 |
2,876 |
Jul-30-2019, 01:13 PM |
|
|
Thread: If Statement Help
Post: RE: If Statement Help
i dont know if understand correcly but i wil try to help cann you provided the expected results ??
try this
is_male = True
is_female = False
if is_male and not(is_female):
name =(input("Ple... |
|
cvsae |
General Coding Help |
6 |
2,876 |
Jul-30-2019, 01:03 PM |
|
|
Thread: Can a function modify a variable outside it?
Post: RE: Can a function modify a variable outside it?
(Jul-30-2019, 12:11 AM)Exsul Wrote: I'm very new to programming. Why are global variables bad, and what should I use instead?
Read about global variables http://wiki.c2.com/?GlobalVariablesAreBad
... |
|
cvsae |
General Coding Help |
3 |
5,965 |
Jul-30-2019, 12:47 AM |