Welcome to Code Forum!

Join a community that supports you and your coding journey from day one. We strive to be a friendly, supportive community that empowers everyone to be better developers. By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Search results

  1. skifli

    Python What is the difference between GET vs POST vs PUT? Mainly POST vs PUT?

    GET: Nothing on the server is changed - you are simply getting a resource from the server. POST: Updates a resource on the server - it is not idempotent. The outcome may not be the same each time. PUT: Puts a resource on the server - completely replacing whatever was there before with the new...
  2. skifli

    Python Request for help with type conversion

    # Definition of savings and result savings = 100 result = 100 * 1.10 ** 7 # Fix the printout print("I started with $" + savings + " and now have $" + result + ". Awesome!") # Definition of pi_string pi_string = "3.1415926" # Convert pi_string into float: pi_float pi_float = float(pi_string)...
  3. skifli

    Python Feedback on a program I made.

    Hi @Johna, I've now completely re-written the app in Python, so there's no need for any PHP files! You can find the updated code here. Hopefully it should work now.
  4. skifli

    Python python easy question...

    You have told the program to return `True` if the numbers equal each other. This code should work. def can_date(age1, age2): """return""" if age1 // 2 + 7 == age2: return True elif age2 // 2 + 7 == age1: return True elif age1 == age2: return False else...
  5. skifli

    Python Exception is always raised + my function is not working

    You have made a simple mistake. In if statements, statements seperated by and / or are completely separate. This means, instead of doing `type_of_degrees.upper() != "C" or "F" or "K":` you should do `type_of_degrees.upper() != "C" and type_of_degrees.upper() != "F" and type_of_degrees.upper() !=...
  6. skifli

    Python Tweepy Code Issue

    I think they just forgot to put the 'i' in the code tag.
  7. skifli

    Python Tweepy Code Issue

    I'm not sure, and I don't think anyone here specialises in the Tweepy Python module. Try posting this question on Stack Overflow, where there may be people more suited to help you.
  8. skifli

    Python Tweepy Code Issue

    Does this work? mport tweepy import datetime access_token="access token here" access_token_secret="access token secret here" consumer_key="consumer key here" consumer_secret="consumer secret here" auth= tweepy.OAuthHandler(consumer_key,consumer_secret)...
  9. skifli

    Python Can somebody help me out with this assignment?

    demian_s = demian.strip() demian_list = demian.split() demian_line = demian.splitlines() print(demian_s) print() print(f'demian split: {demian_list}') print(f'demian splitlines: {demian_line}')
  10. skifli

    Python What is abstraction level? Explain this definition to me please.

    Abstraction is the act of removing unnecessary details from problems. An abstraction level defines how complex an instruction is. The higher the abstraction level, the less detail. The lower the level, the more detail.
  11. skifli

    Python .get doesn't seem to work :/

    By the way, there is a problem in your dictionary initialization. It should look like this: digit_mapping = { "1": "One", "2": "Two", "3": "Three", "4": "Four" }
  12. skifli

    Python .get doesn't seem to work :/

    There is no .get function in Python. What are you trying to do?
  13. skifli

    Python Having problems with if statements in python

    Heres the fixed code @getrickrolled. To compare values in Python, you have to use `>=` (greater than), and `<=` (less than). You also made another mistake new Python coders make. Conditions seperated by `and` / `or` are completely seperate, so instead of doing `total_score == >3 and >5` you...
  14. skifli

    Python Need help with python calculator issue (bug?)

    You need to convert the user's choice into an integer. Since the user's choice is a str, none of the if statements are fulfilled and it runs the code in the else statement. I have improved your code a bit as well. operator = int(input("Choose an operator (1 = Add, 2 = Subtract, 3 = Divide, 4 =...
  15. skifli

    JavaScript File Uploads

    Dear CF, What libraries are good for handling file uploads using JS? I am trying to make a file upload server that does not use PHP. Any code snippets would be appreciated.
  16. skifli

    Python Can anyone help me code a simple python code?

    Here you go. print("agent in call .....") text = input("Enter certain text: ") print(f"You entered {text}.") print(f"The length of the text is {len(text)}.") print(f"The text from index 7 onwards is {text[7:]}.") print(f"The first letter in your text is: {text[0]} and the last letter in...
  17. skifli

    Python I'm writing a bot so that people don't give themselves money from the bot unbelievaboat?

    Okay, hopefully THIS will work: import discord from discord.ext import commands from time import sleep client = discord.Client() client = commands.Bot(command_prefix="!") @client.event async def on_ready(): print(f"Logged in as {client.user} (ID: {client.user.id}).")...
  18. skifli

    Python I'm writing a bot so that people don't give themselves money from the bot unbelievaboat?

    Try this: import discord from discord.ext import commands from time import sleep client = discord.Client() client = commands.Bot(command_prefix="!") @client.event async def on_ready(): print(f"Logged in as {client.user} (ID: {client.user.id}).") @client.command(name="add-money")...
  19. skifli

    Python I'm writing a bot so that people don't give themselves money from the bot unbelievaboat?

    That's your fault. You changed the code I provided, so you did something wrong,
Back
Top Bottom