Search Results
|
Post |
Author |
Forum |
Replies |
Views |
Posted
[asc]
|
|
|
Thread: test error
Post: test error
def get_input_as_int(arg):
try:
result = int(arg)
return result
except ValueError:
raise ValueError("Argument is not all digits")
def file_count(filename, items=None)... |
|
MCL169 |
Homework |
0 |
35,603 |
May-29-2023, 08:43 PM |
|
|
Thread: remote work
Post: remote work
I am changing careers later in life and started back to school. I want to have the freedom to work remotely and stay employable. I'm finishing up my first course "intro to python programming and need ... |
|
MCL169 |
Jobs |
1 |
2,242 |
May-26-2023, 01:58 PM |
|
|
Thread: notation
Post: RE: notation
for line in lines: # str, '19260701,0.09,-0.22,-0.30,0.009\n'
21 curr_line = line.split() # list, ['19260701', '0.09', '... |
|
MCL169 |
General Coding Help |
8 |
2,809 |
Apr-14-2023, 12:06 PM |
|
|
Thread: notation
Post: RE: notation
(Apr-14-2023, 10:45 AM)DeaD_EyE Wrote: I often use generators to process something line by line or element by element.
To convert a date, you should read the docs: https://docs.python.org/3/library/... |
|
MCL169 |
General Coding Help |
8 |
2,809 |
Apr-14-2023, 12:02 PM |
|
|
Thread: notation
Post: RE: notation
(Apr-14-2023, 06:30 AM)buran Wrote: (Apr-14-2023, 04:46 AM)MCL169 Wrote: If split creates a lists of strings is [0] the first line in the file or the first item in a list?What is lines in the firs... |
|
MCL169 |
General Coding Help |
8 |
2,809 |
Apr-14-2023, 10:14 AM |
|
|
Thread: notation
Post: RE: notation
If split creates a lists of strings is [0] the first line in the file or the first item in a list? |
|
MCL169 |
General Coding Help |
8 |
2,809 |
Apr-14-2023, 04:46 AM |
|
|
Thread: notation
Post: notation
for line in lines: # str, '19260701,0.09,-0.22,-0.30,0.009\n'
curr_line = line.split() # list, ['19260701', '0.09', '-0.22, ... |
|
MCL169 |
General Coding Help |
8 |
2,809 |
Apr-14-2023, 01:49 AM |
|
|
Thread: code won't advance to next statement
Post: code won't advance to next statement
while True: # bool, True
year = input('please enter a 4-digit year: ')
digit = len(year) # int, 4
if... |
|
MCL169 |
General Coding Help |
2 |
1,337 |
Apr-11-2023, 07:53 PM |
|
|
Thread: python convert multiple files to multiple lists
Post: RE: python convert multiple files to multiple list...
(Apr-09-2023, 06:19 PM)snippsat Wrote: If this is basic Python training should also try to the task with Python,Pandas is a different beast🦄
To give a example,eg result of col1 2.87.
lst = []
with o... |
|
MCL169 |
General Coding Help |
6 |
2,887 |
Apr-09-2023, 07:16 PM |
|
|
Thread: python convert multiple files to multiple lists
Post: RE: python convert multiple files to multiple list...
(Apr-09-2023, 08:43 AM)snippsat Wrote: (Apr-08-2023, 10:39 PM)MCL169 Wrote: I'm trying to create a list for each line using delimiter so i can sum totals of a columnThis task can also be simpler i... |
|
MCL169 |
General Coding Help |
6 |
2,887 |
Apr-09-2023, 05:30 PM |
|
|
Thread: python convert multiple files to multiple lists
Post: python convert multiple files to multiple lists
year = '1990'
filename = open('FF_abbreviated.txt')
for i in filename:
print(i)Output:19260701 0.09 0.22 0.30 0.009
19260702 0.44 0.35 0.08 0.009
19260706 0.17 0.26... |
|
MCL169 |
General Coding Help |
6 |
2,887 |
Apr-08-2023, 10:39 PM |
|
|
Thread: restrict user input to numerical values
Post: RE: restrict user input to numerical values
(Apr-08-2023, 05:00 PM)Yoriz Wrote: Maybe you could use the strings isdigit method
if digit != 4 or not year.isdigit():That did the trick Thanks! |
|
MCL169 |
General Coding Help |
2 |
1,616 |
Apr-08-2023, 05:40 PM |
|
|
Thread: restrict user input to numerical values
Post: restrict user input to numerical values
while True:
year = input('please enter a 4-digit year: ')
digit = len(year)
if digit != 4 and year != int:
print("sorry, that was bad input")
else:
print(f"thanks ! y... |
|
MCL169 |
General Coding Help |
2 |
1,616 |
Apr-08-2023, 04:45 PM |
|
|
Thread: input variable choice
Post: RE: input variable choice
(Feb-19-2023, 08:55 PM)deanhystad Wrote: You are asking your user to enter "police academy" or "corner lookout". This would be quite difficult for your user because you provide no info about what i... |
|
MCL169 |
General Coding Help |
7 |
2,036 |
Feb-19-2023, 09:00 PM |
|
|
Thread: input variable choice
Post: RE: input variable choice
print('Welcome to The Bronx')
choose = input('Will you fight for good or bad?: ')
good = "police academy"
bad = "corner lookout"
if choose == 'good':
print(good)
elif choose == 'bad':
print(b... |
|
MCL169 |
General Coding Help |
7 |
2,036 |
Feb-19-2023, 08:59 PM |
|
|
Thread: input variable choice
Post: RE: input variable choice
(Feb-19-2023, 07:01 PM)noisefloor Wrote: Hi,
you need to bind the result of input() to a variable - otherwise the input just disappears.
Like:
name = input('What is your name?')
print(f'Hello {nam... |
|
MCL169 |
General Coding Help |
7 |
2,036 |
Feb-19-2023, 08:08 PM |
|
|
Thread: input variable choice
Post: RE: input variable choice
print('Welcome to The Bronx')
choose = input('Will you fight for good or bad?: ')
good = "police academy"
bad = "corner lookout"
if choose == 'good':
print(good)
elif choose == 'bad':
print(b... |
|
MCL169 |
General Coding Help |
7 |
2,036 |
Feb-19-2023, 08:01 PM |
|
|
Thread: input variable choice
Post: input variable choice
I'm using simple ideas and theories to practice coding. I'm simply trying to except a input from user that returns a variable string. I want the user to choose a patch that will be developed as i go.
... |
|
MCL169 |
General Coding Help |
7 |
2,036 |
Feb-19-2023, 06:54 PM |
|
|
Thread: NYU PYTHON CERTIFICATE
Post: NYU PYTHON CERTIFICATE
I am starting a new career in software development late in life and I am looking for the fastest track at least to get my foot in the door. I wanted to know if anybody went the route of an NYU certifi... |
|
MCL169 |
Jobs |
0 |
2,527 |
Jan-25-2023, 04:09 AM |
|
|
Thread: Starting New Programming Career after 50
Post: RE: Starting New Programming Career after 50
Thanks for the input. In a perfect world I could combine my photography with my programing
skills and be highly marketable with good earning potential. But I guess like my mentor said it's all in th... |
|
MCL169 |
News and Discussions |
4 |
2,108 |
Jan-23-2023, 05:19 AM |