Formatting user input with .title() method - python-3.x

Currently, I started to learn programming with Python. Currently, I am tackling my first 'real' project.
The most problems that I seem to find, are based around formatting. I am curious if my code is written understandable. For example:
new_customer = input('Name? \n')
customer = new_customer.title()
I want to make sure all the inputs received are saved with the same format.
Is this the correct way to transform a user's input with the .title() method?
Thank you in advance, I hope that these kind of questions are accepted here!

You can use the same variable:
newcustomer = input('Name? \n').title()
Is this what you mean?

Related

What kind of LUA encoding is that?

everyone,
I am not so familiar with coding but I have been looking for hours now without answer. Maybe because I do not know what am I looking for.
I have found an LUA code with the below encoded code,
I was wondering which kind of encoding it is? Is there a specific name for it, is there a way to decrypt it? for the curious one, it looks like :
return(function(aaEE_IIlIllIlII,aaEE_lIlIIIIIlI,aaEE_llIIlIIllllIl)local aaEE_IIllllIIlIIllIlIIII=string.char;local aaEE_lIlllIlIllIIIlIlIl=string.sub;local aaEE_IlIlIIIllIlIIIllllIIIIIIl=table.concat;local aaEE_IIIIIIlllIIIIllllIlIII=math.ldexp;local aaEE_IIIlIIllIIllIIlIIllIllII=getfenv or function()return _ENV end;local aaEE_lIllIIIIIllllIlIlIl=select;local aaEE_lIlIlllIllIIII=unpack or table.unpack;local aaEE_llllIlllllIlIlIl=tonumber;local function aaEE_lllIllIIIlIIlllIIll(aaEE_IIlIllIlII)local aaEE_llllIIllllIll,aaEE_lIIlIlllIlllIIIllIIlIllI,aaEE_lIlIlllIllIIII="","",{}local aaEE_IlIllIlllIIlIllllIll=256;local aaEE_IIllIllIIIlIIlllIIlIII={}for aaEE_lIlIIIIIlI=0,aaEE_IlIllIlllIIlIllllIll-1 do aaEE_IIllIllIIIlIIlllIIlIII[aaEE_lIlIIIIIlI]=aaEE_IIllllIIlIIllIlIIII(aaEE_lIlIIIIIlI)end;local aaEE_lIlIIIIIlI=1;local function aaEE_IlIlllllllIIlI()local aaEE_llllIIllllIll=aaEE_llllIlllllIlIlIl(aaEE_lIlllIlIllIIIlIlIl(aaEE_IIlIllIlII,aaEE_lIlIIIIIlI,aaEE_lIlIIIIIlI),36)aaEE_lIlIIIIIlI=aaEE_lIlIIIIIlI+1;local aaEE_lIIlIlllIlllIIIllIIlIllI=aaEE_llllIlllllIlIlIl(aaEE_lIlllIlIllIIIlIlIl(aaEE_IIlIllIlII,aaEE_lIlIIIIIlI,aaEE_lIlIIIIIlI+aaEE_llllIIllllIll-1),36)aaEE_lIlIIIIIlI=aaEE_lIlIIIIIlI+aaEE_llllIIllllIll;return aaEE_lIIlIlllIlllIIIllIIlIllI end;aaEE_llllIIllllIll=aaEE_IIllllIIlIIllIlIIII(aaEE_IlIlllllllIIlI())aaEE_lIlIlllIllIIII[1]=aaEE_llllIIllllIll;while aaEE_lIlIIIIIlI<#aaEE_IIlIllIlII do local aaEE_lIlIIIIIlI=aaEE_IlIlllllllIIlI()if aaEE_IIllIllIIIlIIlllIIlIII[aaEE_lIlIIIIIlI]then aaEE_lIIlIlllIlllIIIllIIlIllI=aaEE_IIllIllIIIlIIlllIIlIII[aaEE_lIlIIIIIlI]else aaEE_lIIlIlllIlllIIIllIIlIllI=aaEE_llllIIllllIll..aaEE_lIlllIlIllIIIlIlIl(aaEE_llllIIllllIll,1,1)end;aaEE_IIllIllIIIlIIlllIIlIII[aaEE_IlIllIlllIIlIllllIll]=aaEE_llllIIllllIll..aaEE_lIlllIlIllIIIlIlIl(aaEE_lIIlIlllIlllIIIllIIlIllI,1,1)aaEE_lIlIlllIllIIII[#aaEE_lIlIlllIllIIII+1],aaEE_llllIIllllIll,aaEE_IlIllIlllIIlIllllIll=aaEE_lIIlIlllIlllIIIllIIlIllI,aaEE_lIIlIlllIlllIIIllIIlIllI,aaEE_IlIllIlllIIlIllllIll+1 end;return table.concat(aaEE_lIlIlllIllIIII)end;
https://pastebin.com/4HU5pFHZ
Thank you for your answers and explanation
Its called obfuscation (you can look up "lua obfuscator" or "script obfuscator" for more information) and just makes the code unreadable. I've already seen this obfuscation but i can't recall the name of it, its a paid one tho.
This is the best encryption see here.
1 = Let's encrypt lua code com or: LuaEncrypt.exe.
2 = Let's chamar or encrypted lua code.
3 = To call this encrypted code, we will use AmsLuac.dll created in C++
https://github.com/AmsPluginsBox/Encrypt-Lua-Code

In the code igniter 3, how is the unique code applied in online nominal payments?

I'm a beginner in programming. please allow me to ask. So I'm making a top up form with Codeigniter 3. I want to give a unique code for each nominal top up. For example, a member will top up 100,000, then what must be transferred is 100,123 (example). how to generate 3 numbers behind it?
Thanks for reading and willing to help
please let me help to answer the question. I think, you just add another php function, for random numbers as needed.
My Example code like this:
<?php
// get top up value from form
$value_top_up = 100000;
// add random number
$value_top_up += rand(100,999);
// example result = 100729
echo $value_top_up;
?>

Netlogo: Creating subsets of agentsets of a particular breed

I am still new to Netlogo, but I can not find an explanation for this in the documentation.
I am trying to create a subset of an agentset that only contains one type of breed. It would seem that I could use "with" to perform this, but for some reason that does not work.
This code works:
ask link-neighbors with [shape = "person"][
set pmt (pmt + dist)
]
But this code does not:
ask link-neighbors with [breed = "psngrs"][
set pmt (pmt + dist)
]
How can I create a subset of an agentset with only this particular breed?
Thanks!
This question is showing as unanswered, though Alan gave the correct answer in a comment. So, just so I stop clicking on this thinking it is unanswered, I'm going to reiterate what he said as an answer. Alan, if you add your comment as answer, I'll happily delete mine.
Anyway, just get rid of the quotes around the breed name, like so:
link-neighbors with [breed = psngrs]

How to parse an ISO string value to a NodaTime Instant?

I am getting to know NodaTime and like it a lot. But I don't know it that well (yet)!
Given a value such as '2014-04-08T09:30:18Z', what are the steps required to parse such a string to a NodaTime Instant?
Thank you!
I figured this out. For others who want to do the same thing, here is what I used:
var isoString = "2014-04-08T09:30:18Z";
var result = InstantPattern.GeneralPattern.Parse(isoString).Value;
The Value property in this case returns the actual Instant object. If you omit that, the result is of type ParseResult<Instant> in this case, and has other information such as whether the parsing succeeded, etc.
http://nodatime.org/1.2.x/api/html/T_NodaTime_Text_ParseResult_1.htm
There aren't a lot of examples on Noda Time yet, but I am really liking it and turning to it more and more. Fantastic work by the team who created it. Thank you!

Scanner to TextIO question

I need to add a value and input it directly into an array using TextIO.
I know that if I was using Scanner I would use the in.nextDouble() function, but how would I do it using TextIO?
TextIO.put("Enter credit hours:");
creditHour[sem][grd]+=in.nextDouble(); //I have to use TextIO here.
Thanks in advance,
Found it.
array [i][r] = TextIO.getlnDouble();

Resources