Share your repls and programming experiences

← Back to all posts
Databases
51LV3RC0D3R

I have to questions:
1. How do I make it so that instead of printing a like this {key1, key2, key3, key4} but instead like this:

  1. How do I make it so that it looks at the whole database and says that if the value is this, then show the value1: key1, and if it's not then don't show it?
Voters
51LV3RC0D3R
Comments
hotnewtop
Coder100
  1. use loops
  1. use if statements

conclusion: python wants you to use for loops

51LV3RC0D3R

Thank you @Coder100!

Coder100

mark as correct answer please! @51LV3RC0D3R

51LV3RC0D3R

@Coder100 For some reason I can't(mark you as correct answer):

Coder100

you can't what @51LV3RC0D3R

51LV3RC0D3R

@Coder100 OHHH i know why, it is because I posted this in share accidentally.

Coder100

you can't what @51LV3RC0D3R

51LV3RC0D3R

@Coder100 Also, one more question, is there a way I can assign say for instance chattinginput more than one value? And can I print that certain value, and not the rest?

Coder100

@51LV3RC0D3R

  1. arrays
  1. yeah
51LV3RC0D3R

@Coder100 It says Type Error: list indices must be integers.

Coder100

well read the error
are you sure you didn't add something like a float or a string? It can only be an int like 0 @51LV3RC0D3R

51LV3RC0D3R

@Coder100 but I want a variable like uname...so is there a way I can do that?

Coder100

use the search to get an index?? @51LV3RC0D3R

51LV3RC0D3R

@Coder100 wdym?