Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Cryptography in Python
Post: Cryptography in Python (Encrypt and Decrypt)

So I was able to come up with the following code: def encrypt(text): result = "" s = 3 # traverse text for i in range(len(text)): char = text[i] # Encrypt uppercase charact...
NLittle17 General Coding Help 6 4,425 Jan-13-2019, 07:11 PM
    Thread: Cryptography in Python
Post: RE: Cryptography in Python

(Jan-10-2019, 12:58 PM)Larz60+ Wrote: There are better ways to do this: If you are using python 3.6 or newer: >>> import string >>> funk = '{|}' >>> mystr = f'{string.asc...
NLittle17 General Coding Help 6 4,425 Jan-13-2019, 03:40 PM
    Thread: Calculating averages in Python
Post: Calculating averages in Python

It is a something that I am working on and I need help with it. scores = [['HERBERT H. LEHMAN YABC', 6, 402, 373, 413], ['QUEENS SATELLITE HIGH SCHOOL FOR OPPORTUNITY', 6, 403, 408, 367], ['FORSYTH S...
NLittle17 General Coding Help 1 2,442 Jan-13-2019, 12:42 PM
    Thread: Cryptography in Python
Post: RE: Cryptography in Python

(Jan-10-2019, 12:07 PM)Larz60+ Wrote: As your ultimate goal, are you trying to display something like this: https://python-reference.readthedocs.io/...ASCII.html ? I am trying to have an output like...
NLittle17 General Coding Help 6 4,425 Jan-10-2019, 12:09 PM
    Thread: Cryptography in Python
Post: Cryptography in Python

print("CryptoPrac-1a.") for x in range(97, 123): # 97 starts the lowercase alphabet and 122 is z (ending) print(chr(x), end = ' ') print('\n') for x in range(97, 123): print(chr(x + 3), end = ' '...
NLittle17 General Coding Help 6 4,425 Jan-10-2019, 10:59 AM
    Thread: create a function for odd integers
Post: RE: create a function for odd integers

(Jan-07-2019, 07:43 PM)ichabod801 Wrote: As I said in the other thread, you need to convert number to an integer with int(). You ignored the last comment back on that thread so I had to make a new o...
NLittle17 General Coding Help 4 3,177 Jan-07-2019, 09:29 PM
    Thread: create a function for odd integers
Post: create a function for odd integers

So I am trying to create a function for odd integers. I would like to have the user input any number and then have the program test if it is evenly divisible by 2. If so, I would like it to return Fal...
NLittle17 General Coding Help 4 3,177 Jan-07-2019, 06:09 PM
    Thread: BBCode tags
Post: RE: Functions in Python

(Jan-07-2019, 05:50 PM)ichabod801 Wrote: Use python tags. You have been asked to do this repeatedly. You need to convert number to an integer with int() before applying the % operator. I never see t...
NLittle17 Board 5 4,272 Jan-07-2019, 05:55 PM
    Thread: how to use the return function
Post: RE: Functions in Python

(Jan-07-2019, 05:34 PM)ichabod801 Wrote: Yeah, that's what it should do. It's designed to get a choice from 1-5. Once it gets that value, it returns it and stops. Are you expecting it to do somethin...
NLittle17 General Coding Help 5 3,217 Jan-07-2019, 05:45 PM
    Thread: BBCode tags
Post: BBCode tags

So I am trying to create a function for odd integers. I would like to have the user input any number and then have the program test if it is evenly divisible by 2. If so, I would like it to return Fal...
NLittle17 Board 5 4,272 Jan-07-2019, 05:41 PM
    Thread: how to use the return function
Post: RE: Functions in Python

(Jan-05-2019, 11:44 PM)ichabod801 Wrote: As per your other thread, the function works fine for me, are you calling it (get_choice())? Hello. Yes I am calling it get_choice() after the Return choice ...
NLittle17 General Coding Help 5 3,217 Jan-07-2019, 05:28 PM
    Thread: how to use the return function
Post: how to use the return function

Again. Trying to teach myself how to use the return function. This is me trying to get a user to make a choice between 1-5 and then returning their choice. I don’t know now returns work but if someone...
NLittle17 General Coding Help 5 3,217 Jan-05-2019, 10:00 PM
    Thread: Functions in Python
Post: Functions in Python

I am trying to write a script that takes in a number and returns True of it is odd and False if it is even. Here’s what I have so far. I want to use the return method but nothing is coming out after I...
NLittle17 General Coding Help 1 2,040 Jan-05-2019, 09:54 PM
    Thread: Dictionary python program
Post: RE: Dictionary python program

(Jan-05-2019, 05:53 PM)Larz60+ Wrote: you really haven't made much of an effort. Is this a homework assignment? to add to an item, use: sales['beef'] += 2 I have made much of an effort. If you don’t...
NLittle17 General Coding Help 7 3,217 Jan-05-2019, 07:31 PM
    Thread: Dictionary python program
Post: RE: Dictionary python program

There’s still nothing similar to what I need to do. I need a simple code addition to mine. Please add to the code snippet that I previously posted.
NLittle17 General Coding Help 7 3,217 Jan-05-2019, 03:32 PM
    Thread: Dictionary python program
Post: RE: Dictionary python program

(Jan-05-2019, 03:06 PM)Larz60+ Wrote: what have you tried (code)? sales = {"beef" : 4, "catfish" : 8, "alfredo" : 12, "peppers" : 18} print(sales) And I’m stuck.
NLittle17 General Coding Help 7 3,217 Jan-05-2019, 03:07 PM
    Thread: Dictionary python program
Post: Dictionary python program

I’m trying to write a script where I create a dictionary with some initial keys and values. I made some of those values above 10 and some less than 10. sales = {"beef" : 4, "catfish" : 8, "alfredo" :...
NLittle17 General Coding Help 7 3,217 Jan-05-2019, 03:04 PM
    Thread: Splitting strings in python?
Post: RE: Splitting strings in python?

(Jan-05-2019, 09:01 AM)Axel_Erfurt Wrote: word = "potlucks" for i in range(2, len(word) + 1): print(word[:i])Output:po pot potl potlu potluc potluck potlucks I'd want it to read po tl uc ks
NLittle17 General Coding Help 3 2,440 Jan-05-2019, 09:12 AM
    Thread: Using for loop in Python lists script?
Post: RE: Using for loop in Python lists script?

(Jan-04-2019, 10:04 PM)NLittle17 Wrote: If you have a list like below and now need to print a message for grades over 65 saying “You passed!” and another message saying “Sorry, you failed.” for grad...
NLittle17 General Coding Help 4 2,964 Jan-05-2019, 08:46 AM
    Thread: Splitting strings in python?
Post: Splitting strings in python?

I am trying to learn how to split a word into increments of 2. What I have so far is: word = "potlucks" i = 0 print(word[0:2]) OUTPUT: po ** So if I want it to continue increasing by letters until ...
NLittle17 General Coding Help 3 2,440 Jan-05-2019, 08:35 AM

User Panel Messages

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