Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: logging in simple program
Post: logging in simple program

Hello everyone. Below I am sharing the code of a simple working calculator. Program works well but i need to obtain this: Enter action, select number 1 Addition, 2 Substraction , 3 Multiplication, 4 D...
Inkanus General Coding Help 1 1,723 Dec-17-2020, 08:23 PM
    Thread: Generating random business cards
Post: RE: Generating random business cards

Error: select the type of business card: b - business, h - home: b please select number of cards 2 Traceback (most recent call last): File "main.py", line 16, in <module> contacts = create...
Inkanus General Coding Help 2 2,208 Dec-08-2020, 09:30 PM
    Thread: Generating random business cards
Post: Generating random business cards

Hello everyone. I can't write a function that generates random business cards in a python's faker. The function is to assume two parameters: the type of the business card (business or home) and the qu...
Inkanus General Coding Help 2 2,208 Dec-08-2020, 09:23 PM
    Thread: Calculator with logging library
Post: RE: Calculator with logging library

(Nov-25-2020, 04:18 AM)deanhystad Wrote: What are you supposed to log? I made simple calculator but now i got the assignment to improve it. Unfortunately, no one explained to me how to do it. All I ...
Inkanus General Coding Help 3 2,111 Nov-25-2020, 02:34 PM
    Thread: Simple Palindrome
Post: RE: Simple Palindrome

Thanks! All the code looks like this: s = "Kajak kajak" s = s.lower() def is_palindrome(i): if len(i) <= 1: return True else: if i[0] != i[len(i)-1]: return False ...
Inkanus General Coding Help 4 2,126 Nov-25-2020, 01:48 PM
    Thread: Calculator with logging library
Post: Calculator with logging library

I wrote a calculator but it doesn't count **smile** I have to use the logging library but i don't know how. Previously, everything worked without this library, now the program does not count. Please ...
Inkanus General Coding Help 3 2,111 Nov-24-2020, 10:42 PM
    Thread: Simple Palindrome
Post: Simple Palindrome

Hi. I have simple program which checks if a string is a palindrome def is_palindrome(i): if len(i) <= 1: return True else: if i[0] != i[len(i)-1]: return False ...
Inkanus General Coding Help 4 2,126 Nov-24-2020, 08:26 PM
    Thread: Creating a dictionary from a list
Post: Creating a dictionary from a list

Hello. I'm having trouble creating a dictionary from a list. I have a list with names. I am supposed to build a dictionary on its basis. Each name has to be assigned the number of characters for the n...
Inkanus General Coding Help 5 3,170 Nov-05-2020, 10:38 PM
    Thread: How to capitalize in dictionary
Post: RE: How to capitalize in dictionary

(Oct-27-2020, 04:30 PM)Larz60+ Wrote: You have lists for dictionary values, so must access each element in "grocery" and save back as value.title() example: pond_animals = { "fish": ["trout", "s...
Inkanus General Coding Help 2 3,691 Oct-28-2020, 01:20 PM
    Thread: How to capitalize in dictionary
Post: How to capitalize in dictionary

Hi everyone. I ran into a problem. I would like words in the dictionary that are written in lowercase to be displayed in uppercase. I thought I found a solution but it only works with a list. shopping...
Inkanus General Coding Help 2 3,691 Oct-27-2020, 03:00 PM
    Thread: Counting the values ​​in the dictionary
Post: RE: Counting the values ​​in the dictionary

(Oct-26-2020, 09:38 AM)Askic Wrote: I'd do something like this: dict1 = { "key1": ["a", "b", "c"], "key2": ["x", "y", "z"] } count = 0 for j in dict1.values(): count += len(j) print(coun...
Inkanus General Coding Help 7 3,666 Oct-26-2020, 01:28 PM
    Thread: Counting the values ​​in the dictionary
Post: RE: Counting the values ​​in the dictionary

I did that simple iteration for i in dict: print("I will go to", i, "and i will buy:", dict[i] And it's good. The keys and their values ​​are printed is this how to count all the values?
Inkanus General Coding Help 7 3,666 Oct-26-2020, 08:59 AM
    Thread: Counting the values ​​in the dictionary
Post: Counting the values ​​in the dictionary

Hi. I have some problem with dictionary. My dictionary has two keys, and each key has three values ​​assigned to it. I would like to count the amount of values. I don't know what to apply to get six ...
Inkanus General Coding Help 7 3,666 Oct-26-2020, 08:34 AM

User Panel Messages

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