Python Forum
20 Years of records (Sports)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
20 Years of records (Sports)
#1
Hey guys,
First of all, I'm Federico, I'm from Turin,Italy and I'm 20 y.o.
I started with Python just two weeks ago, so please don't kill me for my mistakes  Undecided Undecided
This is a little program, now it's just about football, but if you like the idea I can add more sports (such as tennis and basketball), more competitions and more stats...
I'd like to receive your thoughts on it and new ideas to improve it  Smile

I posted here because I wasn't able to link it. If that's not right I will change the post how you want: https://github.com/Sani96/20-years-of-re...atabase.py
Reply
#2
#Football
class Football:
   ligue_name: ""
   ligue_year: ""
   ligue_winner: ""
   ligue_top_scorers: ""
is this Python Code ?

it works when I change it to:


#Football
class Football:
    ligue_name = ""
    ligue_year = ""
    ligue_winner = ""
    ligue_top_scorers = ""
Then you always have to enter everything with single quotes, that's not a good idea.

football - That should be enough, not 'football'
Reply
#3
Yes Axel, sorry for the equal sign, I didn't see it
About the single quotes, I don't understand what you mean...
Reply
#4
the question is


Quote:Type here the sport you want to look for. E.g. 'football' or 'tennis'...


I type

football


Quote:The sport you're looking for is not available now. Try again!

I must type

'football'

and so on with each new question
Reply
#5
When I wrote 'football', I meant that you can type football without single quotes...
I could be wrong, but if I try it with single quotes it doesn't work, while if I write the word without them, it works normally...
Reply
#6
in Python 3 it works, in Python 2 you must use single quotes

You should tell the user to use Python 3.
Reply
#7
(Feb-18-2017, 07:53 PM)Sani96 Wrote: When I wrote 'football', I meant that you can type football without single quotes...
I could be wrong, but if I try it with single quotes it doesn't work, while if I write the word without them, it works normally...

That shouldn't matter.

*checks your source*
If you're using python2, definitely do not use the input() function.  Use raw_input() instead.  Then you don't need to type quotes around whatever you're entering.
Reply
#8
All that data... You can serialise it as JSON and store it on the hard drive. That way you can keep the program simple and small.
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020